Difference between revisions of "CoreInterface PrintTitle Example"
From BRL-CAD
m (BRLCAD::bad_alloc) |
m |
||
Line 1: | Line 1: | ||
+ | [[category:Code examples]] | ||
+ | |||
#include <iostream> | #include <iostream> | ||
Latest revision as of 09:48, 15 November 2009
#include <iostream> #include <brlcad/ConstDatabase.h> int main ( int argc, char* argv[] ) { int ret = 0; if (argc < 2) { std::cout << "Usage: " << argv[0] << " <BRL-CAD Database>"; ret = 1; } else { try { BRLCAD::ConstDatabase database; if (database.Load(argv[1])) std::cout << database.Title(); else { std::cout << "Could not load file: " << argv[1]; ret = 2; } } catch(BRLCAD::bad_alloc& e) { std::cout << "Out of memory in: " << e.what(); ret = 3; } } return ret; }