nux-0.9.48
|
00001 /* 00002 * Copyright 2010 Inalogic® Inc. 00003 * 00004 * This program is free software: you can redistribute it and/or modify it 00005 * under the terms of the GNU Lesser General Public License, as 00006 * published by the Free Software Foundation; either version 2.1 or 3.0 00007 * of the License. 00008 * 00009 * This program is distributed in the hope that it will be useful, but 00010 * WITHOUT ANY WARRANTY; without even the implied warranties of 00011 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR 00012 * PURPOSE. See the applicable version of the GNU Lesser General Public 00013 * License for more details. 00014 * 00015 * You should have received a copy of both the GNU Lesser General Public 00016 * License along with this program. If not, see <http://www.gnu.org/licenses/> 00017 * 00018 * Authored by: Jay Taoko <jaytaoko@inalogic.com> 00019 * 00020 */ 00021 00022 00023 #ifndef NPARSING_H 00024 #define NPARSING_H 00025 00026 namespace nux 00027 { 00028 00030 00037 bool ParseCommand (const TCHAR **Stream, const TCHAR *Match); 00038 00040 00047 bool Parse_u32 (const TCHAR *stream, const TCHAR *Match, DWORD &value); 00048 00050 00059 bool Parse_tchar (const TCHAR *stream, const TCHAR *Match, TCHAR *value, t_int size, t_int MaxLen); 00060 00062 00069 bool Parse_u8 (const TCHAR *Stream, const TCHAR *Match, BYTE &Value); 00071 00078 bool Parse_s8 (const TCHAR *Stream, const TCHAR *Match, SBYTE &Value); 00080 00087 bool Parse_u16 (const TCHAR *Stream, const TCHAR *Match, WORD &Value); 00089 00096 bool Parse_s16 (const TCHAR *Stream, const TCHAR *Match, SWORD &Value); 00098 00105 bool Parse_float (const TCHAR *Stream, const TCHAR *Match, float &Value); 00107 00114 bool Parse_int (const TCHAR *Stream, const TCHAR *Match, t_int &Value); 00116 00123 bool Parse_string (const TCHAR *Stream, const TCHAR *Match, NString &Value); 00125 00132 bool Parse_u64 (const TCHAR *Stream, const TCHAR *Match, QWORD &Value); 00134 00141 bool Parse_s64 (const TCHAR *Stream, const TCHAR *Match, SQWORD &Value); 00143 00150 bool Parse_bool (const TCHAR *Stream, const TCHAR *Match, bool &OnOff); 00151 00153 00161 bool ParseLine (const TCHAR **Stream, TCHAR *LineBuffer, t_int BufferSize); 00162 00164 00171 bool ParseLine (const TCHAR **Stream, NString &LineString); 00172 00174 00180 bool ParseToken (const TCHAR *Str, TCHAR *TokenBuffer, t_int BufferSize); 00181 00183 00188 bool ParseToken (const TCHAR *Str, NString &TokenString); 00189 00191 00195 NString ParseToken (const TCHAR *Str); 00196 00198 00206 void ParseToNextLine (const TCHAR **Stream, TCHAR CommentChar); 00207 00209 00215 bool ParseParam (const TCHAR *Stream, const TCHAR *Param); 00216 00217 00218 } 00219 00220 #endif // NPARSING_H 00221 00222