MCPcopy Create free account
hub / github.com/NVIDIAGameWorks/PhysX / ProcessLine

Method ProcessLine

physx/samples/samplebase/wavefront.cpp:252–339  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

250
251
252 int InPlaceParser::ProcessLine(int lineno,char *line,InPlaceParserInterface *callback)
253 {
254 int ret = 0;
255
256 const char *argv[MAXARGS];
257 int argc = 0;
258
259 char *foo = line;
260
261 while ( !EOS(*foo) && argc < MAXARGS )
262 {
263
264 foo = SkipSpaces(foo); // skip any leading spaces
265
266 if ( EOS(*foo) ) break;
267
268 if ( *foo == mQuoteChar ) // if it is an open quote
269 {
270 foo++;
271 if ( argc < MAXARGS )
272 {
273 argv[argc++] = foo;
274 }
275 while ( !EOS(*foo) && *foo != mQuoteChar ) foo++;
276 if ( !EOS(*foo) )
277 {
278 *foo = 0; // replace close quote with zero byte EOS
279 foo++;
280 }
281 }
282 else
283 {
284
285 foo = AddHard(argc,argv,foo); // add any hard separators, skip any spaces
286
287 if ( IsNonSeparator(*foo) ) // add non-hard argument.
288 {
289 bool quote = false;
290 if ( *foo == mQuoteChar )
291 {
292 foo++;
293 quote = true;
294 }
295
296 if ( argc < MAXARGS )
297 {
298 argv[argc++] = foo;
299 }
300
301 if ( quote )
302 {
303 while (*foo && *foo != mQuoteChar ) foo++;
304 if ( *foo ) *foo = 32;
305 }
306
307 // continue..until we hit an eos ..
308 while ( !EOS(*foo) ) // until we hit EOS
309 {

Callers

nothing calls this directly

Calls 1

ParseLineMethod · 0.80

Tested by

no test coverage detected