tesseract  4.0.0-1-g2a2b
tesseract::StringParam Class Reference

#include <params.h>

Inheritance diagram for tesseract::StringParam:
tesseract::Param

Public Member Functions

 StringParam (const char *value, const char *name, const char *comment, bool init, ParamsVectors *vec)
 
 ~StringParam ()
 
 operator STRING & ()
 
const char * string () const
 
const char * c_str () const
 
bool empty ()
 
bool operator== (const STRING &other)
 
void operator= (const STRING &value)
 
void set_value (const STRING &value)
 
void ResetToDefault ()
 
- Public Member Functions inherited from tesseract::Param
 ~Param ()=default
 
const char * name_str () const
 
const char * info_str () const
 
bool is_init () const
 
bool is_debug () const
 
bool constraint_ok (SetParamConstraint constraint) const
 

Additional Inherited Members

- Protected Member Functions inherited from tesseract::Param
 Param (const char *name, const char *comment, bool init)
 
- Protected Attributes inherited from tesseract::Param
const char * name_
 
const char * info_
 
bool init_
 
bool debug_
 

Detailed Description

Definition at line 190 of file params.h.

Constructor & Destructor Documentation

◆ StringParam()

tesseract::StringParam::StringParam ( const char *  value,
const char *  name,
const char *  comment,
bool  init,
ParamsVectors vec 
)
inline

Definition at line 192 of file params.h.

194  : Param(name, comment, init) {
195  value_ = value;
196  default_ = value;
197  params_vec_ = &(vec->string_params);
198  vec->string_params.push_back(this);
199  }
Param(const char *name, const char *comment, bool init)
Definition: params.h:131

◆ ~StringParam()

tesseract::StringParam::~StringParam ( )
inline

Definition at line 200 of file params.h.

200 { ParamUtils::RemoveParam<StringParam>(this, params_vec_); }

Member Function Documentation

◆ c_str()

const char* tesseract::StringParam::c_str ( ) const
inline

Definition at line 203 of file params.h.

203 { return value_.string(); }
const char * string() const
Definition: strngs.cpp:196

◆ empty()

bool tesseract::StringParam::empty ( )
inline

Definition at line 204 of file params.h.

204 { return value_.length() <= 0; }
int32_t length() const
Definition: strngs.cpp:191

◆ operator STRING &()

tesseract::StringParam::operator STRING & ( )
inline

Definition at line 201 of file params.h.

201 { return value_; }

◆ operator=()

void tesseract::StringParam::operator= ( const STRING value)
inline

Definition at line 206 of file params.h.

206 { value_ = value; }

◆ operator==()

bool tesseract::StringParam::operator== ( const STRING other)
inline

Definition at line 205 of file params.h.

205 { return value_ == other; }

◆ ResetToDefault()

void tesseract::StringParam::ResetToDefault ( )
inline

Definition at line 208 of file params.h.

208  {
209  value_ = default_;
210  }

◆ set_value()

void tesseract::StringParam::set_value ( const STRING value)
inline

Definition at line 207 of file params.h.

207 { value_ = value; }

◆ string()

const char* tesseract::StringParam::string ( ) const
inline

Definition at line 202 of file params.h.

202 { return value_.string(); }
const char * string() const
Definition: strngs.cpp:196

The documentation for this class was generated from the following file: