X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Example%2FPrintFile.cxx;h=6135c783aa29c9efe929b31f5c9c012aee98e439;hb=1e8074191600434684069ea9fad2931507fcdb2f;hp=c7e882c6be2460e344f17e710b9540a3c2d4316b;hpb=aaeee7164728ec0749a525f0c74274865712ec37;p=gdcm.git diff --git a/Example/PrintFile.cxx b/Example/PrintFile.cxx index c7e882c6..6135c783 100644 --- a/Example/PrintFile.cxx +++ b/Example/PrintFile.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: PrintFile.cxx,v $ Language: C++ - Date: $Date: 2005/01/24 16:10:49 $ - Version: $Revision: 1.26 $ + Date: $Date: 2005/04/05 10:28:59 $ + Version: $Revision: 1.31 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -21,34 +21,38 @@ #include -int main(int argc, char* argv[]) +int main(int argc, char *argv[]) { gdcm::File *e1; gdcm::FileHelper *f1; - std::string fileName; - if (argc != 2) + std::string fileName; + + if (argc == 1) { - std::cout << " usage : PrintDocument fileName printLevel debug" + std::cout << " usage : PrintFile fileName printLevel debug " + << "short (=NOSEQ + NOSHADOW)" << std::endl; + return 0; } + e1 = new gdcm::File(); + if (argc > 1) { fileName=argv[1]; } - else - { - fileName += GDCM_DATA_ROOT; - fileName += "/test.acr"; - } if (argc > 3) - gdcm::Debug::SetDebugOn(); + gdcm::Debug::DebugOn(); + + if (argc > 4) + e1->SetLoadMode(NO_SEQ | NO_SHADOW); - e1 = new gdcm::File( fileName.c_str() ); + e1->Load( fileName.c_str() ); + f1 = new gdcm::FileHelper(e1); - if (argc > 2) + if (argc > 2) // keep it here (f1 needs to be constructed !) { int level = atoi(argv[2]); f1->SetPrintLevel(level); @@ -105,6 +109,7 @@ int main(int argc, char* argv[]) std::cout <