~haggai-eran/nux/rtl-rebased

« back to all changes in this revision

Viewing changes to NuxCore/Parsing.cpp

  • Committer: Jay Taoko
  • Date: 2011-10-21 23:49:15 UTC
  • mfrom: (508.1.2 nux-20)
  • Revision ID: jay.taoko@canonical.com-20111021234915-hnzakb5ndebica8i
* Removed custom Nux types: t_u32, t_s32, t_bool, ...

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
    else return false; // No match.
58
58
  }
59
59
 
60
 
  bool Parse_tchar (const TCHAR *Stream, const TCHAR *Match, TCHAR *Value, t_int Size, t_int MaxLen)
 
60
  bool Parse_tchar (const TCHAR *Stream, const TCHAR *Match, TCHAR *Value, int Size, int MaxLen)
61
61
  {
62
62
    const TCHAR *Found = Strfind (Stream, Match);
63
63
    const TCHAR *Start;
217
217
      return false;
218
218
 
219
219
    Temp += StringLength (Match);
220
 
    Value = (t_u16) CharToInteger (Temp);
 
220
    Value = (unsigned short) CharToInteger (Temp);
221
221
    return Value != 0 || IsDigitChar (Temp[0]);
222
222
  }
223
223
 
229
229
      return false;
230
230
 
231
231
    Temp += StringLength (Match);
232
 
    Value = (t_s16) CharToInteger (Temp);
 
232
    Value = (short) CharToInteger (Temp);
233
233
    return Value != 0 || IsDigitChar (Temp[0]);
234
234
  }
235
235
 
244
244
    return true;
245
245
  }
246
246
 
247
 
  bool Parse_int (const TCHAR *Stream, const TCHAR *Match, t_int &Value)
 
247
  bool Parse_int (const TCHAR *Stream, const TCHAR *Match, int &Value)
248
248
  {
249
249
    const TCHAR *Temp = Strfind (Stream, Match);
250
250
 
296
296
    }
297
297
  }
298
298
 
299
 
  bool ParseToken (const TCHAR *Str, TCHAR *TokenBuffer, t_int BufferSize)
 
299
  bool ParseToken (const TCHAR *Str, TCHAR *TokenBuffer, int BufferSize)
300
300
  {
301
 
    t_int sz = 0;
 
301
    int sz = 0;
302
302
 
303
303
    while ( (*Str == TEXT (' ') ) || (*Str == CHAR_TAB) )
304
304
    {
384
384
// Get a line of Stream (everything up to, but not including, CR/LF.
385
385
// Returns 0 if ok, nonzero if at end of stream and returned 0-length string.
386
386
//
387
 
  bool ParseLine (const TCHAR **Stream, TCHAR *LineBuffer, t_int BufferSize)
 
387
  bool ParseLine (const TCHAR **Stream, TCHAR *LineBuffer, int BufferSize)
388
388
  {
389
389
    TCHAR *tmp = LineBuffer;
390
390
    *tmp = 0;