12 #ifndef _UT_OPTION_FILE_H_INCLUDED_
13 #define _UT_OPTION_FILE_H_INCLUDED_
41 virtual
bool save(const
char *filename, std::ostream &os,
49 bool load(
const char *filename,
UT_IStream &is,
51 bool save(
const char *filename, std::ostream &os,
56 void addError(
const char *error_str )
const;
71 bool save(
const char *filename, std::ostream &os,
93 bool save(
const char *filename )
const;
94 bool load(
const char *filename,
UT_IStream &is);
95 bool save(
const char *filename, std::ostream &os )
const;
96 bool save(
const char *filename, FILE *file )
const;
98 bool hasOption(
const char *
name )
const;
99 void removeOption(
const char *name );
101 void getOption(
const char *name,
int &
value,
int defvalue )
const;
102 void getOption(
const char *name,
exint &value,
exint defvalue )
const;
103 void getOption(
const char *name,
bool &value,
bool defvalue )
const;
104 void getOption(
const char *name,
fpreal32 &value,
fpreal32 defvalue )
const;
105 void getOption(
const char *name,
fpreal64 &value,
fpreal64 defvalue )
const;
106 void getOption(
const char *name,
UT_String &value,
108 void getOption(
const char *name,
UT_String &value,
109 const char *defvalue )
const;
113 const char *defvalue )
const;
114 void getOption(
const char *name,
UT_Vector2 &value,
116 void getOption(
const char *name,
UT_Vector3 &value,
118 void getOption(
const char *name,
UT_Vector4 &value,
122 void getOption(
const char *name,
UT_Matrix3 &value,
124 void getOption(
const char *name,
UT_Matrix4 &value,
126 void getOption(
const char *name,
UT_Color &value,
129 void setOption(
const char *name,
int value );
130 void setOption(
const char *name,
exint value );
131 void setOption(
const char *name,
bool value );
132 void setOption(
const char *name,
fpreal32 value );
133 void setOption(
const char *name,
fpreal64 value );
135 void setOption(
const char *name,
const UT_String &value );
137 void setOption(
const char *name,
const char *value );
138 void setOption(
const char *name,
const UT_Vector2 &value );
139 void setOption(
const char *name,
const UT_Vector3 &value );
140 void setOption(
const char *name,
const UT_Vector4 &value );
141 void setOption(
const char *name,
const UT_Quaternion &value );
142 void setOption(
const char *name,
const UT_Matrix3 &value );
143 void setOption(
const char *name,
const UT_Matrix4 &value );
144 void setOption(
const char *name,
const UT_Color &value);
154 : myOptionFile(option_file)
159 : myOptionFile(option_file), myIter(iter)
165 return myIter.name();
168 template <
typename _T>
171 myOptionFile.getOption(myIter.name(),
value, defvalue);
181 return !(*
this ==
cmp);
215 template <
typename _T>
219 myIter.name(),
value);
229 return !(*
this ==
cmp);
246 return iterator(*
this, myOptions.begin());
259 #endif // _UT_OPTION_FILE_H_INCLUDED_
bool operator!=(const const_iterator &cmp)
bool load(const char *filename, UT_IStream &is, UT_OptionValueMap &options) override
GT_API const UT_StringHolder filename
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
GLsizei const GLfloat * value
const_iterator end() const
UT_OptionValueMap::const_iterator myIter
const_iterator begin() const
bool save(const char *filename, std::ostream &os, const UT_OptionValueMap &options) const override
void getValue(_T &value, const _T &defvalue) const
void setOption(const char *name, int value)
const_iterator & operator++()
bool operator!=(const iterator &cmp) const
const UT_OptionFile & myOptionFile
bool operator==(const iterator &cmp) const
base_iterator< const ITEM_T, const_map_iterator > const_iterator
IMATH_HOSTDEVICE constexpr int cmp(T a, T b) IMATH_NOEXCEPT
iterator(UT_OptionFile &option_file, UT_OptionValueMap::const_iterator iter)
const_iterator operator++(int)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLuint const GLchar * name
const_iterator(const UT_OptionFile &option_file)
iterator(UT_OptionFile &option_file)
virtual bool parseLine(const char *line, UT_OptionValueMap &options)
UT_SymbolMap< UT_StringHolder > UT_OptionValueMap
const_iterator(const UT_OptionFile &option_file, UT_OptionValueMap::const_iterator iter)
bool operator==(const const_iterator &cmp)
LeafData & operator=(const LeafData &)=delete
const char * name() const
virtual ~UT_OptionParser()