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