20 #include <osg/Drawable>
21 #include <osg/StateAttribute>
22 #include <osg/ArgumentParser>
24 #include <osgDB/ReaderWriter>
25 #include <osgDB/Options>
48 return dynamic_cast<const T*
>(proto) != 0;
71 void setWithinQuotes(
bool withinQuotes=
true);
72 bool getWithinQuotes();
74 void setNoNestedBrackets(
int no);
75 int getNoNestedBrackets();
89 FieldType getFieldType()
const;
93 bool isOpenBracket()
const;
94 bool isCloseBracket()
const;
97 bool matchWord(
const char* str)
const;
98 bool matchWord(
const char* str,
int noCharacters)
const;
100 bool isString()
const;
101 bool matchString(
const char* str)
const;
102 bool matchString(
const char* str,
int noCharacters)
const;
103 bool isQuotedString()
const;
105 const char* getStr()
const;
109 bool matchInt(
int i)
const;
110 bool getInt(
int& i)
const;
113 bool matchUInt(
unsigned int i)
const;
114 bool getUInt(
unsigned int& i)
const;
116 bool isFloat()
const;
117 bool matchFloat(
float f)
const;
118 bool getFloat(
float& f)
const;
119 bool getFloat(
double& f)
const;
121 static FieldType calculateFieldType(
const char* str,
bool withinQuotes=
false);
127 void _copy(
const Field& ic);
152 void attach(std::istream* input);
155 virtual bool eof()
const;
157 bool readField(
Field& fieldPtr);
161 int getNoNestedBrackets()
const;
165 bool _readField(
Field* fieldPtr);
174 bool findStartOfNextField();
176 int _noNestedBrackets;
178 bool _delimiterEatLookUp[256];
179 bool _delimiterKeepLookUp[256];
189 MINIMUM_FIELD_READER_QUEUE_SIZE = 10
198 void attach(std::istream* input);
201 virtual bool eof()
const;
205 void insert(
int pos,
Field* field);
206 void insert(
int pos,
const char* str);
208 Field& operator [] (
int pos);
209 Field& field (
int pos);
216 void advanceOverCurrentFieldOrBlock();
217 void advanceToEndOfCurrentBlock();
218 void advanceToEndOfBlock(
int noNestBrackets);
220 bool matchSequence(
const char* str);
222 bool readSequence(
const char* keyword,std::string& value);
223 bool readSequence(
const char* keyword,
unsigned int& value);
224 bool readSequence(
const char* keyword,
int& value);
225 bool readSequence(
const char* keyword,
float& value);
226 bool readSequence(
const char* keyword,
osg::Vec2f& value);
227 bool readSequence(
const char* keyword,
osg::Vec3f& value);
228 bool readSequence(
const char* keyword,
osg::Vec4f& value);
229 bool readSequence(
const char* keyword,
osg::Vec2d& value);
230 bool readSequence(
const char* keyword,
osg::Vec3d& value);
231 bool readSequence(
const char* keyword,
osg::Vec4d& value);
233 bool readSequence(std::string& value);
234 bool readSequence(
unsigned int& value);
235 bool readSequence(
int& value);
236 bool readSequence(
float& value);
254 Field* _previousField;
258 int _fieldQueueCapacity;
291 virtual osg::Object* readObject(
const std::string& fileName);
293 virtual osg::Node* readNode(
const std::string& fileName);
294 virtual osg::Shader* readShader(
const std::string& fileName);
296 virtual osg::Object* getObjectForUniqueID(
const std::string& uniqueID);
297 virtual void registerUniqueIDForObject(
const std::string& uniqueID,
osg::Object* obj);
301 bool read(Parameter value1);
302 bool read(Parameter value1, Parameter value2);
303 bool read(Parameter value1, Parameter value2, Parameter value3);
304 bool read(Parameter value1, Parameter value2, Parameter value3, Parameter value4);
305 bool read(Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5);
306 bool read(Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5, Parameter value6);
307 bool read(Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5, Parameter value6, Parameter value7);
308 bool read(Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5, Parameter value6, Parameter value7, Parameter value8);
310 bool read(
const char* str);
311 bool read(
const char* str, Parameter value1);
312 bool read(
const char* str, Parameter value1, Parameter value2);
313 bool read(
const char* str, Parameter value1, Parameter value2, Parameter value3);
314 bool read(
const char* str, Parameter value1, Parameter value2, Parameter value3, Parameter value4);
315 bool read(
const char* str, Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5);
316 bool read(
const char* str, Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5, Parameter value6);
317 bool read(
const char* str, Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5, Parameter value6, Parameter value7);
318 bool read(
const char* str, Parameter value1, Parameter value2, Parameter value3, Parameter value4, Parameter value5, Parameter value6, Parameter value7, Parameter value8);
322 typedef std::map< std::string, osg::ref_ptr<osg::Object> > UniqueIDToObjectMapping;
323 UniqueIDToObjectMapping _uniqueIDToObjectMap;
331 #endif // __SG_INPUT_H
virtual ~basic_type_wrapper()
FieldReader & getFieldReader()
bool matches(const osg::Object *proto) const
int getNoCharacters() const
void readImage(const osg::Image *image, O &operation)
virtual bool matches(const osg::Object *proto) const =0