2 * Copyright (c) 2013 TOYOTA MOTOR CORPORATION.
6 * Licensed under the Apache License, Version 2.0 (the License){}
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an AS IS BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
18 #ifndef CICOBLOCKPARSER_H
19 #define CICOBLOCKPARSER_H
27 * Part head string define
29 #define D_PTF1 "\"stateMachine\""
30 #define D_PTS1 "\"state\""
31 #define D_PTS2 "\"finalState\""
32 #define D_PTS3 "\"historyState\""
33 #define D_PTS4 "\"event\""
37 * Perform a block classification defined string.
38 * perform a json parse
44 * @brief The CicoBlockParser class
46 class CicoBlockParser{
49 UNKNOWN = 0, // unknown
50 STTMAC = 1, // state machine
52 HSTT, // history state
57 virtual ~CicoBlockParser();
60 bool getStateMachineParts(const char* tmpstr);
61 const std::string& getError();
62 int spaceLess(char* d, const char* s) const;
63 void* getVoid() const;
64 void setVoid(void* v);
65 bool jsonParse(const char* objectname);
66 bool isJsonParse() const;
67 void getErrorHead(std::string& errhead, const char* strtop);
71 std::vector<CicoBlockParser*> m_childs;
75 const char* getBrackets(char* tmpstr, const char* tmpend);
78 static std::string m_err;
84 * @brief get error message
85 * @return error message
87 inline const std::string& CicoBlockParser::getError()
93 * @brief get void pointer
94 * @return void pointer
96 inline void* CicoBlockParser::getVoid() const
102 * @brief set void pointer
103 * @param v register void pointer
105 inline void CicoBlockParser::setVoid(void* v)
111 * @brief json parse condhition
112 * @return treu:parse / false:not parse
114 inline bool CicoBlockParser::isJsonParse() const
116 if ((char*)0 != m_jsonTmp) {
122 #endif // CICOBLOCKPARSER_H