2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseUtil_ScannerImpl.h
19 * @brief This is the header file for the _ScannerImpl class.
21 * This header file contains declarations and definitions of the _ScannerImpl class.
25 #ifndef _FBASE_UTIL_SCANNER_IMPL_H_
26 #define _FBASE_UTIL_SCANNER_IMPL_H_
28 #include <FBaseString.h>
29 #include <FBaseUtilRegularExpression.h>
31 namespace Tizen { namespace Base { namespace Utility
34 class _OSP_EXPORT_ _ScannerImpl
35 : public Tizen::Base::Object
39 _ScannerImpl(const _ScannerImpl& scanner);
40 _ScannerImpl& operator =(const _ScannerImpl& scanner);
41 virtual ~_ScannerImpl(void);
43 result Construct(const String& str);
44 result Construct(const String& filePath, const String& encodingScheme);
46 result FindInLine(const String& str, String& MatchedStr);
47 result FindInLine(const RegularExpression& pattern, String& MatchedStr);
49 result GetNextSignedChar(signed char& nextSignedChar);
50 result GetNextSignedChar(signed char& nextSignedChar, int radix);
51 result GetNextInt(int& nextInt);
52 result GetNextInt(int& nextInt, int radix);
53 result GetNextShort(short& nextShort);
54 result GetNextShort(short& nextShort, int radix);
55 result GetNextLongLong(long long& nextLongLong);
56 result GetNextLongLong(long long& nextLongLong, int radix);
57 result GetNextFloat(float& nextFloat);
58 result GetNextDouble(double& nextDouble);
59 result GetNextBool(bool& nextBool);
60 result GetNextLine(String& nextLine);
61 result GetNextToken(String& nextStr);
62 result GetNextToken(const String& pattern, String& nextStr);
63 result GetNextToken(const RegularExpression& pattern, String& nextStr);
66 String GetDelimiter(void);
68 bool HasNextToken(void);
69 bool HasNextToken(const String& pattern);
70 bool HasNextToken(const RegularExpression& pattern);
71 bool IsNextTokenConvertibleToSignedChar(void);
72 bool IsNextTokenConvertibleToSignedChar(int radix);
73 bool IsNextTokenConvertibleToInt(void);
74 bool IsNextTokenConvertibleToInt(int radix);
75 bool IsNextTokenConvertibleToShort(void);
76 bool IsNextTokenConvertibleToShort(int radix);
77 bool IsNextTokenConvertibleToLongLong(void);
78 bool IsNextTokenConvertibleToFloat(void);
79 bool IsNextTokenConvertibleToDouble(void);
80 bool IsNextTokenConvertibleToBool(void);
81 bool HasNextLine(void);
83 void SetRadix(int radix);
84 void SetDelimiter(const String& delimiter);
85 void SetDelimiter(const RegularExpression& pattern);
87 void Skip(const String& str);
88 void Skip(const RegularExpression& pattern);
91 result GetNextTokenWithoutPattern(String& ret, int& length);
96 const wchar_t* __pParseStr;
97 bool __isAllocatedOnHeap;
100 friend class Scanner;
103 }}} // Tizen::Base::Utility
105 #endif // _FBASE_UTIL_SCANNER_IMPL_H_