// // Programmer: Craig Stuart Sapp // Creation Date: Tue Mar 8 17:05:00 PST 2011 // Last Modified: Tue Mar 8 17:05:10 PST 2011 // Filename: ...sig/examples/all/humtable.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/humtable.cpp // Syntax: C++; museinfo // // Description: Print Humdrum file as an HTML table. // #include "humdrum.h" #include #include #ifndef OLDCPP #include #else #include #endif // function declarations void checkOptions (Options& opts, int argc, char* argv[]); void example (void); void usage (const char* command); void createTable (ostream& out, HumdrumFile& infile); void printGlobalComment (ostream& out, HumdrumFile& infile, int line); // global variables Options options; // database for command-line arguments /////////////////////////////////////////////////////////////////////////// int main(int argc, char* argv[]) { HumdrumFile infile, outfile; // process the command-line options checkOptions(options, argc, argv); // figure out the number of input files to process int numinputs = options.getArgCount(); for (int i=0; i\n"; int i; for (i=0; i\n"; } ////////////////////////////// // // printGlobalComment -- // void printGlobalComment(ostream& out, HumdrumFile& infile, int line) { } ////////////////////////////// // // checkOptions -- validate and process command-line options. // void checkOptions(Options& opts, int argc, char* argv[]) { opts.define("author=b", "author of program"); opts.define("version=b", "compilation info"); opts.define("example=b", "example usages"); opts.define("h|help=b", "short description"); opts.process(argc, argv); // handle basic options: if (opts.getBoolean("author")) { cout << "Written by Craig Stuart Sapp, " << "craig@ccrma.stanford.edu, March 2011" << endl; exit(0); } else if (opts.getBoolean("version")) { cout << argv[0] << ", version: March 2011" << endl; cout << "compiled: " << __DATE__ << endl; cout << MUSEINFO_VERSION << endl; exit(0); } else if (opts.getBoolean("help")) { usage(opts.getCommand()); exit(0); } else if (opts.getBoolean("example")) { example(); exit(0); } } ////////////////////////////// // // example -- example usage of the humtable program // void example(void) { cout << " \n" << endl; } ////////////////////////////// // // usage -- gives the usage statement for the humtable program // void usage(const char* command) { cout << " \n" << endl; } // md5sum: 71deb39b03840b1ae8917c862eae7648 humtable.cpp [20100905]