libutil++  1.9.3
 All Classes Functions Variables
String.h
1 /*
2 ** libutil++
3 ** $Id: String.h 1702 2016-08-13 23:26:06Z sella $
4 ** Copyright (c) 2011-2016 Digital Genesis, LLC. All Rights Reserved.
5 ** Released under the LGPL Version 2.1 License.
6 ** http://www.digitalgenesis.com
7 */
8 
9 #ifndef __libutilxx__sella__variant__String_H__
10 #define __libutilxx__sella__variant__String_H__
11 
12 #include "../../common.h"
13 #include "TypeCastException.h"
14 #include "Nullable.h"
15 
16 #include <memory>
17 
18 #include <boost/regex.hpp>
19 
20 namespace sella {
21  namespace variant {
22  class String;
23  }
24 }
25 
27  public:
28  static const boost::regex & Pattern(void) { static boost::regex regex("^\".*\"$"); return regex; }
29  static const int Type = 0x06;
30 
31  public:
32  /* Constructors */
33  String() throw ();
34  String(const std::string &value) throw ();
35  String(std::string &&value) throw ();
36 
37  String(const String &other) throw ();
38  String(String &&other) throw ();
39  virtual ~String() throw ();
40 
41  /* Operators */
42  bool operator==(const String &other) const throw ();
43  bool operator!=(const String &other) const throw ();
44  bool operator>(const String &other) const throw ();
45  bool operator<(const String &other) const throw ();
46  String& operator=(const String &other) throw ();
47  String& operator=(String &&other) throw ();
48  String& operator=(const std::string &other) throw ();
49  String& operator=(const char *other) throw ();
50  String& operator+=(const std::string &value) throw ();
51 
52  /* Public Member Functions */
53  const std::string& get() const throw (UnsupportedOperatorException);
54  std::string& get() throw (UnsupportedOperatorException);
55 
56  size_t size() const throw ();
57  bool empty() const throw ();
58  void clear() throw();
59 
60  virtual void shrink_to_fit() throw ();
61  virtual void msgpack(sella::util::MessagePack &mpack, uint32_t &offset) const throw (TypeCastException);
62  virtual void msgpackBufferSize(size_t &size) const throw ();
63  virtual std::string str(int type) const throw ();
64  virtual int getType(void) throw () { return Type; }
65 
66  static bool isType(const std::string &value) throw () { return isType(value.c_str(), value.size()); }
67  static bool isType(const char *value, size_t size) throw ();
68 };
69 
70 #endif
71 
72 /*
73 ** vim: noet ts=3 sw=3
74 */