// // Programmer: Craig Stuart Sapp // Creation Date: Mon Nov 23 05:24:14 PST 2009 // Last Modified: Mon Nov 23 05:24:18 PST 2009 // Last Modified: Thu Dec 22 11:50:31 PST 2011 Added -V and -k options // Last Modified: Mon Apr 1 00:28:01 PDT 2013 Enabled multiple segment input // Filename: ...sig/examples/all/ridx.cpp // Web Address: http://sig.sapp.org/examples/museinfo/humdrum/ridx.cpp // Syntax: C++; museinfo // // Description: Remove various components of Humdrum file data structures. // #include "humdrum.h" #include "PerlRegularExpression.h" #include #include #ifndef OLDCPP #include #include #else #include #include #endif // function declarations: void checkOptions (Options& opts, int argc, char** argv); void example (void); void usage (const char* command); void processFile (HumdrumFile& infile, int setcount); // User interface variables: Options options; int option_D = 0; // used with -D option int option_d = 0; // used with -d option int option_G = 0; // used with -G option int option_g = 0; // used with -g option int option_I = 0; // used with -I option int option_i = 0; // used with -i option int option_L = 0; // used with -L option int option_l = 0; // used with -l option int option_T = 0; // used with -T option int option_U = 0; // used with -U and -u option int option_M = 0; // used with -M option int option_C = 0; // used with -C option int option_c = 0; // used with -c option int option_k = 0; // used with -k option int option_V = 0; // used with -V option ////////////////////////////////////////////////////////////////////////// int main(int argc, char** argv) { // process the command-line options checkOptions(options, argc, argv); HumdrumFileSet infiles; // infile.setAllocation(1123123); // allow for very large inputs up to // // million lines. int numinputs = options.getArgumentCount(); int i; if (numinputs < 1) { infiles.read(cin); } else { for (i=0; i 1) && (!option_G)) { infile.printNonemptySegmentLabel(cout); } for (i=0; i