// FilenameCommands.cc // Kevin Karplus // 2 May 1998 (moved from GeneralCommands.cc) #include "Input/Input.h" #include "Filenames/Filenames.h" #include "Command/Command.h" static int SetInFilePrefix(istream &in, Command* self, ostream&logfile) { char word[200]; get_word(in, word, '\n'); Filenames::set_in_file_prefix(word); logfile << "# Prefix for input files set to " << word << "\n"; return 1; } static Command PrefixCommand("InFilePrefix", SetInFilePrefix, "With an argument, saves the argument to be used as a prefix for\n\ subsequent input filenames (does not affect output files).\n\ If specifying a directory, remember to include a final slash.\n\ With no argument, eliminates any earlier-defined prefix."); static int SetOutFilePrefix(istream &in, Command* self, ostream&logfile) { char word[200]; get_word(in, word, '\n'); Filenames::set_out_file_prefix(word); logfile << "# Prefix for output files set to " << word << "\n"; return 1; } static Command OutPrefixCommand("OutFilePrefix", SetOutFilePrefix, "With an argument, saves the argument to be used as a prefix for \n\ subsequent output filenames (does not affect input files).\n\ If specifying a directory, remember to include a final slash.\n\ With no argument, eliminates any earlier-defined prefix."); static int SetInFileSuffix(istream &in, Command* self, ostream&logfile) { char word[200]; get_word(in, word, '\n'); Filenames::set_in_file_suffix(word); logfile << "# Suffix for input files set to " << word << "\n"; return 1; } static Command InSuffixCommand("InFileSuffix", SetInFileSuffix, "With an argument, saves the argument to be used as a suffix for \n\ subsequent input filenames (does not affect output files).\n\ With no argument, eliminates any earlier-defined suffix."); static int SetOutFileSuffix(istream &in, Command* self, ostream&logfile) { char word[200]; get_word(in, word, '\n'); Filenames::set_out_file_suffix(word); logfile << "# Suffix for output files set to " << word << "\n"; return 1; } static Command OutSuffixCommand("OutFileSuffix", SetOutFileSuffix, "With an argument, saves the argument to be used as a suffix for \n\ subsequent output filenames (does not affect input files).\n\ With no argument, eliminates any earlier-defined suffix."); //CHANGE LOG: // 2 May 1998 Kevin Karplus // Removed from GeneralCommands, and modified to use // Filename.h instead of Globals.h