MGF Server  2.1
Multigaze framework server
 All Classes Functions
CGDTextParameter.h
1 #pragma once
2 
3 #ifndef GDTEXTPARAMETER_H
4 #define GDTEXTPARAMETER_H
5 
6 #include <string>
7 
8 template <int length>
10 {
11 public:
12  CGDTextParameter() { setValue("-"); }
13 
14  std::string value() { return mValue; }
15 
16  CGDTextParameter & operator=(const std::string &rhs)
17  {
18  setValue(rhs);
19  return *this;
20  }
21 
22 private:
23  void setValue(std::string v)
24  {
25  if (v.length() > length)
26  v = v.substr(0, length);
27 
28  mValue = v;
29  }
30 
31 private:
32  std::string mValue;
33 };
34 
35 #endif