#include <params.h>
Definition at line 231 of file params.h.
◆ StringParam()
tesseract::StringParam::StringParam |
( |
const char * |
value, |
|
|
const char * |
name, |
|
|
const char * |
comment, |
|
|
bool |
init, |
|
|
ParamsVectors * |
vec |
|
) |
| |
|
inline |
Definition at line 233 of file params.h.
235 :
Param(name, comment, init) {
236 value_ = value;
237 default_ = value;
238 params_vec_ = &(vec->string_params);
239 vec->string_params.push_back(this);
240 }
Param(const char *name, const char *comment, bool init)
◆ ~StringParam()
tesseract::StringParam::~StringParam |
( |
| ) |
|
|
inline |
Definition at line 241 of file params.h.
241 {
242 ParamUtils::RemoveParam<StringParam>(this, params_vec_);
243 }
◆ c_str()
const char * tesseract::StringParam::c_str |
( |
| ) |
const |
|
inline |
Definition at line 247 of file params.h.
247 {
248 return value_.c_str();
249 }
◆ contains()
bool tesseract::StringParam::contains |
( |
char |
c | ) |
const |
|
inline |
Definition at line 250 of file params.h.
250 {
251 return value_.find(c) != std::string::npos;
252 }
◆ empty()
bool tesseract::StringParam::empty |
( |
| ) |
const |
|
inline |
Definition at line 253 of file params.h.
253 {
254 return value_.empty();
255 }
◆ operator std::string &()
tesseract::StringParam::operator std::string & |
( |
| ) |
|
|
inline |
Definition at line 244 of file params.h.
244 {
245 return value_;
246 }
◆ operator=()
void tesseract::StringParam::operator= |
( |
const std::string & |
value | ) |
|
|
inline |
Definition at line 259 of file params.h.
259 {
260 value_ = value;
261 }
◆ operator==()
bool tesseract::StringParam::operator== |
( |
const std::string & |
other | ) |
|
|
inline |
Definition at line 256 of file params.h.
256 {
257 return value_ == other;
258 }
◆ ResetFrom()
void tesseract::StringParam::ResetFrom |
( |
const ParamsVectors * |
vec | ) |
|
|
inline |
Definition at line 268 of file params.h.
268 {
269 for (auto *param : vec->string_params) {
270 if (strcmp(param->name_str(),
name_) == 0) {
271
272
273 value_ = *param;
274 break;
275 }
276 }
277 }
◆ ResetToDefault()
void tesseract::StringParam::ResetToDefault |
( |
| ) |
|
|
inline |
Definition at line 265 of file params.h.
265 {
266 value_ = default_;
267 }
◆ set_value()
void tesseract::StringParam::set_value |
( |
const std::string & |
value | ) |
|
|
inline |
Definition at line 262 of file params.h.
262 {
263 value_ = value;
264 }
The documentation for this class was generated from the following file: