tesseract  4.1.1
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 ()
 
void ResetFrom (const ParamsVectors *vec)
 
- 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 220 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 222 of file params.h.

222  { value_ = default_; }
223  void ResetFrom(const ParamsVectors* vec) {
224  for (int i = 0; i < vec->string_params.size(); ++i) {
225  if (strcmp(vec->string_params[i]->name_str(), name_) == 0) {
226  // printf("overriding param %s=%s by =%s\n", name_, value_,
227  // vec->string_params[i]->c_str());
228  value_ = *vec->string_params[i];
229  break;

◆ ~StringParam()

tesseract::StringParam::~StringParam ( )
inline

Definition at line 230 of file params.h.

234 :
235  STRING value_;

Member Function Documentation

◆ c_str()

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

Definition at line 233 of file params.h.

234 :
235  STRING value_;

◆ empty()

bool tesseract::StringParam::empty ( )
inline

Definition at line 234 of file params.h.

234 :
235  STRING value_;

◆ operator STRING &()

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

Definition at line 231 of file params.h.

234 :
235  STRING value_;

◆ operator=()

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

Definition at line 236 of file params.h.

241 : public Param {

◆ operator==()

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

Definition at line 235 of file params.h.

241 : public Param {

◆ ResetFrom()

void tesseract::StringParam::ResetFrom ( const ParamsVectors vec)
inline

Definition at line 239 of file params.h.

241  : public Param {
242  public:
243  DoubleParam(double value, const char* name, const char* comment, bool init,
244  ParamsVectors* vec)
245  : Param(name, comment, init) {
246  value_ = value;
247  default_ = value;
248  params_vec_ = &(vec->double_params);

◆ ResetToDefault()

void tesseract::StringParam::ResetToDefault ( )
inline

Definition at line 238 of file params.h.

241 : public Param {

◆ set_value()

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

Definition at line 237 of file params.h.

241 : public Param {

◆ string()

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

Definition at line 232 of file params.h.

234 :
235  STRING value_;

The documentation for this class was generated from the following file:
tesseract::StringParam::ResetFrom
void ResetFrom(const ParamsVectors *vec)
Definition: params.h:239
tesseract::Param::Param
Param(const char *name, const char *comment, bool init)
Definition: params.h:143
tesseract::Param::name_
const char * name_
Definition: params.h:148
STRING
Definition: strngs.h:45