VISR  0.12.0
Versatile Interactive Scene Renderer
string_parameter.hpp
Go to the documentation of this file.
1 /* Copyright Institute of Sound and Vibration Research - All rights reserved */
2 
3 #ifndef VISR_PML_STRING_PARAMETER_HPP_INCLUDED
4 #define VISR_PML_STRING_PARAMETER_HPP_INCLUDED
5 
6 #include "export_symbols.hpp"
8 
10 
13 
14 #include <initializer_list>
15 #include <istream>
16 #include <string>
17 
18 namespace visr
19 {
20 namespace pml
21 {
22 
23 static constexpr const char * sStringParameterName = "String";
24 
28 class VISR_PML_LIBRARY_SYMBOL StringParameter: public TypedParameterBase<StringParameter, EmptyParameterConfig, detail::compileTimeHashFNV1(sStringParameterName) >
29 {
30 public:
31  explicit StringParameter( std::size_t maxLength = 0 );
32 
33  explicit StringParameter( ParameterConfigBase const & config );
34 
35  explicit StringParameter( EmptyParameterConfig const & config );
36 
40  explicit StringParameter( std::string const & initStr );
41 
42  virtual ~StringParameter() override;
43 
44  char const * str() const;
45 
46  std::size_t empty() const;
47 
48  std::size_t size() const;
49 
55 
56  void assign( char const * newStr );
57 
58  void assign( std::string const & newStr );
59 
60  StringParameter& operator =( std::string const & newStr );
61 
62 
63 
67  std::size_t maxLength() const { return mMaxLength; }
68 
69 private:
70  std::size_t mMaxLength;
71 
72  std::string mStr;
73 };
74 
75 } // namespace pml
76 } // namespace visr
77 
79 
80 #endif // VISR_PML_STRING_PARAMETER_HPP_INCLUDED
static const constexpr ParameterType staticType()
Definition: typed_parameter_base.hpp:41
Definition: options.cpp:10
Definition: parameter_factory.hpp:20
Definition: parameter_config_base.hpp:22
std::size_t maxLength() const
Definition: string_parameter.hpp:67
Definition: string_parameter.hpp:28
#define DEFINE_PARAMETER_TYPE(ParameterClassType, ParameterId, ParameterConfigType)
Definition: parameter_type.hpp:60
Definition: empty_parameter_config.hpp:21