highlighter application  1.1
HCE project utils : highlighter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
HighlightJsonWrapper.hpp
Go to the documentation of this file.
1 
13 #ifndef HIGHLIGHT_JSON_WRAPPER_HPP
14 #define HIGHLIGHT_JSON_WRAPPER_HPP
15 
16 #include <Poco/JSON/Parser.h>
17 #include <Poco/SharedPtr.h>
18 #include <Poco/Timestamp.h>
19 
20 #include "InDataStruct.hpp"
21 #include "JsonObjExtractor.hpp"
22 #include "OutDataStruct.hpp"
23 
24 #define SEARCH_STRING_SEPARATOR "::"
25 
26 using namespace HCE::utils;
27 
29 {
30  protected:
32  public:
33 //----------------------- InPut Param names --------------------------------------------------------------------------------------
34  static const std::string QUERY_NAME;
35  static const std::string CONTENTS_NAME;
36  static const std::string PARAMETERS_NAME;
37  static const std::string RETURN_HASH_NAME;
38 
39  static const std::string PARAM_BRGIN_MARKER_NAME;
40  static const std::string PARAM_END_MARKER_NAME;
41  static const std::string PARAM_MAX_NUMBER_NAME;
42  static const std::string PARAM_DELIMITERS_NAME;
43  static const std::string PARAM_ACRONYMS_NAME;
44  static const std::string PARAM_NUMBERS_AS_WORDS_NAME;
45  static const std::string PARAM_USE_SINGLE_CHARS_NAME;
46  static const std::string PARAM_TIMEOUT;
47 //----------------------- OutPut Param names --------------------------------------------------------------------------------------
48  static const std::string PARAM_ERROR_CODE_NAME;
49  static const std::string PARAM_ERROR_MSG_NAME;
50  static const std::string PARAM_CONTENTS_NAME;
51  static const std::string PARAM_HIGHLIGHTTED_NAME;
52  static const std::string PARAM_FOUND_NAME;
53  static const std::string PARAM_TOTAL_TIME_NAME;
54  protected:
55  Poco::Dynamic::Var extractParam(const std::string& paramName, Poco::JSON::Object::Ptr parametersPtr);
56  void parseParams(Poco::SharedPtr<InDataStruct> inDataStructPtr, Poco::JSON::Object::Ptr parametersPtr);
57  public:
59  Poco::SharedPtr<InDataStruct> inDataFromJsomString(const std::string &jsonString);
60 // cppcheck-suppress *
61  void jsonStringFromOutData(Poco::SharedPtr<OutDataStruct> outDataStructPtr, std::string &outJSONString, Poco::Timestamp::TimeDiff tDiff);
62  virtual ~HighlightJsonWrapper() {}
63 };
64 
65 #endif