Skip to content

Commit

Permalink
after CR2
Browse files Browse the repository at this point in the history
  • Loading branch information
tsung-wei-huang committed Aug 14, 2018
1 parent bd15c60 commit fe63436
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 74 deletions.
26 changes: 17 additions & 9 deletions example/simple.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,29 @@
int main(int argc, char* argv[]){

if(argc != 2){
std::cout << "Usage: ./simple [SPEF file]";
return 1;
std::cerr << "Usage: ./simple [SPEF file]\n";
std::exit(EXIT_FAILURE);
}

if(not std::experimental::filesystem::exists(argv[1])){
std::cout << "Cannot found " << argv[1] << '\n';
return 1;
std::cerr << "can't find " << argv[1] << '\n';
std::exit(EXIT_FAILURE);
}

// Create a SPEF parser
spef::Spef parser;
// Create a SPEF object
spef::Spef spef;

// Invoke the read function and check the return value
if(parser.read(argv[1])){
// Call dump function to see the content
std::cout << parser.dump() << '\n';
if(!spef.read(argv[1])){
std::cerr << *spef.error;
std::exit(EXIT_FAILURE);
}

// TODO:


// Or you can dump to a SPEF.
//std::cout << spef.dump();
}


Loading

0 comments on commit fe63436

Please sign in to comment.