~ubuntu-branches/ubuntu/raring/voxbo/raring

« back to all changes in this revision

Viewing changes to fileformats/ffinfo.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Michael Hanke
  • Date: 2010-06-06 11:33:11 UTC
  • Revision ID: james.westby@ubuntu.com-20100606113311-v3c13imdkkd5n7ae
Tags: upstream-1.8.5~svn1172
ImportĀ upstreamĀ versionĀ 1.8.5~svn1172

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
using namespace std;
 
3
 
 
4
// #include <stdio.h>
 
5
#include <string>
 
6
#include <sys/stat.h>
 
7
#include "dlfcn.h"
 
8
#include "vbprefs.h"
 
9
#include "vbio.h"
 
10
 
 
11
int
 
12
main(int argc,char **argv)
 
13
{
 
14
  stringstream tmps;
 
15
  string thisdir,prevdir;
 
16
 
 
17
  VBFF::LoadFileTypes();
 
18
 
 
19
  if (argc>1) {
 
20
    tokenlist args;
 
21
    int i,j;
 
22
    args.Transfer(argc-1,argv+1);
 
23
    for (i=0; i<args.size(); i++) {
 
24
      cout << "Eligible filetypes for file " << args[i] << endl;
 
25
      vector<VBFF> types=EligibleFileTypes(args[i]);
 
26
      for (j=0; j<(int)types.size(); j++) {
 
27
        cout << "  " << types[j].getName() << endl;
 
28
      }
 
29
    }
 
30
    exit(0);
 
31
  }
 
32
 
 
33
  if (!VBFF::filetypelist.size()) {
 
34
    printErrorMsg(VB_INFO,"No filetypes found.");
 
35
    exit(0);
 
36
  }
 
37
  printf("[I] ffinfo: found the following file formats:\n");
 
38
  vector<VBFF>::iterator ff;
 
39
  for (ff=VBFF::filetypelist.begin(); ff!=VBFF::filetypelist.end(); ff++) {
 
40
    if (ff->getSignature()=="NONE")
 
41
      continue;
 
42
    // following commented out while we're using all built-ins
 
43
    //     if ((thisdir=xdirname(VBFF::filetypelist[i].getPath())) != prevdir) {
 
44
    //       prevdir=thisdir;
 
45
    //       tmps.str("");
 
46
    //       tmps << "In directory " << thisdir << ":";
 
47
    //       printErrorMsg(VB_INFO,tmps.str());
 
48
    //     }
 
49
    printf("[I]   %s (%s) id=%s ext=%s support=",
 
50
           ff->getName().c_str(),
 
51
           ff->getPath().c_str(),
 
52
           ff->getSignature().c_str(),
 
53
           ff->extension.c_str());
 
54
    if (ff->read_1D) printf("read1d ");
 
55
    if (ff->write_1D) printf("write1d ");
 
56
    if (ff->read_data_3D) printf("read3d ");
 
57
    if (ff->write_3D) printf("write3d ");
 
58
    if (ff->read_data_4D) printf("read4d ");
 
59
    if (ff->write_4D) printf("write4d ");
 
60
    printf("\n");
 
61
  }
 
62
  exit(0);
 
63
}