00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef SERIALIZATION_PREPROCESSOR_HPP_INCLUDED
00019 #define SERIALIZATION_PREPROCESSOR_HPP_INCLUDED
00020
00021 #include <iosfwd>
00022 #include <map>
00023 #include <string>
00024 #include <vector>
00025
00026 struct preproc_define
00027 {
00028 preproc_define() : value(""), arguments(), textdomain(""), linenum(0), location("") {}
00029 explicit preproc_define(std::string const &val) : value(val), arguments(), textdomain(""), linenum(0), location("") {}
00030 preproc_define(std::string const &val, std::vector< std::string > const &args,
00031 std::string const &domain, int line, std::string const &loc)
00032 : value(val), arguments(args), textdomain(domain), linenum(line), location(loc) {}
00033 std::string value;
00034 std::vector< std::string > arguments;
00035 std::string textdomain;
00036 int linenum;
00037 std::string location;
00038 bool operator==(preproc_define const &) const;
00039 bool operator!=(preproc_define const &v) const { return !operator==(v); }
00040 };
00041
00042 struct preproc_config {
00043 struct error {
00044 error(const std::string& msg) : message(msg) {}
00045 std::string message;
00046 };
00047 };
00048
00049 typedef std::map< std::string, preproc_define > preproc_map;
00050
00051
00052
00053
00054 std::istream *preprocess_file(std::string const &fname,
00055 preproc_map *defines = NULL, std::string *error_log=NULL);
00056
00057 #endif