14 #ifndef CONFIGDECLARATION_H 15 #define CONFIGDECLARATION_H 37 const std::string &string_value,
int decl_seq);
46 MAKE_PROPERTY(page, get_page);
47 MAKE_PROPERTY(variable, get_variable);
49 INLINE
const std::string &get_string_value()
const;
50 INLINE
void set_string_value(
const std::string &value);
52 INLINE
size_t get_num_words()
const;
54 INLINE
bool has_string_word(
size_t n)
const;
55 INLINE
bool has_bool_word(
size_t n)
const;
56 INLINE
bool has_int_word(
size_t n)
const;
57 INLINE
bool has_int64_word(
size_t n)
const;
58 INLINE
bool has_double_word(
size_t n)
const;
60 INLINE std::string get_string_word(
size_t n)
const;
61 INLINE
bool get_bool_word(
size_t n)
const;
62 INLINE
int get_int_word(
size_t n)
const;
63 INLINE int64_t get_int64_word(
size_t n)
const;
64 INLINE
double get_double_word(
size_t n)
const;
66 void set_string_word(
size_t n,
const std::string &value);
67 void set_bool_word(
size_t n,
bool value);
68 void set_int_word(
size_t n,
int value);
69 void set_int64_word(
size_t n, int64_t value);
70 void set_double_word(
size_t n,
double value);
74 INLINE
int get_decl_seq()
const;
76 void output(std::ostream &out)
const;
77 void write(std::ostream &out)
const;
80 static size_t extract_words(
const std::string &str, vector_string &words);
81 static std::string
downcase(
const std::string &s);
85 void check_bool_word(
size_t n);
86 void check_int_word(
size_t n);
87 void check_int64_word(
size_t n);
88 void check_double_word(
size_t n);
93 std::string _string_value;
97 F_checked_bool = 0x0001,
98 F_valid_bool = 0x0002,
99 F_checked_int = 0x0004,
100 F_valid_int = 0x0008,
101 F_checked_double = 0x0010,
102 F_valid_double = 0x0020,
103 F_checked_int64 = 0x0040,
104 F_valid_int64 = 0x0080,
117 typedef std::vector<Word> Words;
124 INLINE std::ostream &operator << (std::ostream &out,
const ConfigDeclaration &decl);
The internal definition of a ConfigVariable.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
string downcase(const string &s)
Returns the input string with all uppercase letters converted to lowercase.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is the base class of both ConfigVariable and ConfigVariableCore.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int extract_words(const string &str, vector_string &words)
Divides the string into a number of words according to whitespace.
The name of a file, such as a texture file or an Egg file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A page of ConfigDeclarations that may be loaded or unloaded.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
A single declaration of a config variable, typically defined as one line in a .prc file,...