/// help message (and exits). -d <dir> will make it write the
/// output file(s) to dir instead of current working directory
-
/// \brief Print Version
///
/// Prints the program's version number.
"<message-file> is the name of the input message file.\n";
}
-
-/// \brief Create Time
-///
-/// Returns the current time as a suitably-formatted string.
-///
-/// \return Current time
-
-string
-currentTime() {
-
- // Get a text representation of the current time.
- time_t curtime;
- time(&curtime);
- struct tm* timeinfo;
- timeinfo = localtime(&curtime);
-
- char buffer[80];
- strftime(buffer, 80, "%a %b %d %Y %H:%M", timeinfo);
-
- return (std::string(buffer));
-}
-
-
/// \brief Create Header Sentinel
///
/// Given the name of a file, create an \#ifdef sentinel name. The name is
return (sentinel_text);
}
-
/// \brief Quote String
///
/// Inserts an escape character (a backslash) prior to any double quote
return (outstring);
}
-
/// \brief Sorted Identifiers
///
/// Given a dictionary, return a vector holding the message IDs in sorted
return (ident);
}
-
/// \brief Split Namespace
///
/// The $NAMESPACE directive may well specify a namespace in the form a::b.
return (isc::util::str::tokens(ns, ":"));
}
-
/// \brief Write Opening Namespace(s)
///
/// Writes the lines listing the namespaces in use.
}
}
-
/// \brief Write Closing Namespace(s)
///
/// Writes the lines listing the namespaces in use.
/// \param output_directory if not null NULL, output files are written
/// to the given directory. If NULL, they are written to the current
/// working directory.
-
void
-writeHeaderFile(const string& file, const vector<string>& ns_components,
- MessageDictionary& dictionary, const char* output_directory)
-{
+writeHeaderFile(const string& file,
+ const vector<string>& ns_components,
+ MessageDictionary& dictionary,
+ const char* output_directory) {
Filename message_file(file);
Filename header_file(Filename(message_file.name()).useAsDefault(".h"));
if (output_directory != NULL) {
hfile.close();
}
-
/// \brief Convert Non Alpha-Numeric Characters to Underscores
///
/// Simple function for use in a call to transform
-
char
replaceNonAlphaNum(char c) {
return (isalnum(c) ? c : '_');
}
-
/// \brief Write Program File
///
/// Writes the C++ source code file. This defines the text of the message
/// to the given directory. If NULL, they are written to the current
/// working directory.
void
-writeProgramFile(const string& file, const vector<string>& ns_components,
+writeProgramFile(const string& file,
+ const vector<string>& ns_components,
MessageDictionary& dictionary,
- const char* output_directory)
-{
+ const char* output_directory) {
Filename message_file(file);
Filename program_file(Filename(message_file.name()).useAsDefault(".cc"));
if (output_directory) {
quoteString(dictionary.getText(*i)) << "\",\n";
}
-
// ... and the postamble
ccfile <<
" NULL\n" <<
ccfile.close();
}
-
/// \brief Error and exit if there are duplicate entries
///
/// If the input file contained duplicate message IDs, we print an
/// error for each of them, then exit the program with a non-0 value.
///
/// \param reader Message Reader used to read the file
-
void
errorDuplicates(MessageReader& reader) {
}
}
-
/// \brief Main Program
///
/// Parses the options then dispatches to the appropriate function. See the
/// main file header for the invocation.
-
int
main(int argc, char* argv[]) {
}
return (0);
-
}