HCE project C++ developers source code library  1.1.1
HCE project developer library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
SphinxInputJsonMessageIndex.hpp
Go to the documentation of this file.
1 
14 #ifndef SPHINX_INPUT_JSON_MESSAGE_INDEX_HPP
15 #define SPHINX_INPUT_JSON_MESSAGE_INDEX_HPP
16 
17 #include "JsonSerializable.hpp"
18 
19 namespace HCE
20 {
21 namespace sphinx
22 {
23 //-----------------------------------------------------------------------------
25 {
26 public:
27  SphinxInputJsonMessageIndex(const std::string& json="");
29 
30  bool serialize(std::string& json);
31  bool unserialize(const std::string& json);
32 
33  void setIndexName(const std::string& indexName_) {indexName=indexName_;}
34  std::string getIndexName(void) const {return indexName;}
35 
36  void setDocumentFile(const std::string& documentFile_) {documentFile=documentFile_;}
37  std::string getDocumentFile(void) const {return documentFile;}
38 
39  void addParameters(const std::string& paramName, const std::string& paramValue);
40  std::vector<std::pair<std::string, std::string> >& getParameters(void) {return params;}
41 private:
42  std::string indexName;
43  std::string documentFile;
44  std::vector<std::pair<std::string, std::string> > params;
45 
46  friend std::istream& operator>>(std::istream& is, SphinxInputJsonMessageIndex& messageIndex);
47  friend std::ostream& operator<<(std::ostream& os, const SphinxInputJsonMessageIndex& messageIndex);
48  typedef IJsonSerializable inherited;
49 };
50 //-----------------------------------------------------------------------------
51 //-----------------------------------------------------------------------------
52 } // end namespace sphinx
53 } // end namespace HCE
54 
55 #endif // SPHINX_INPUT_JSON_MESSAGE_INDEX_HPP