OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ConfigOptionString Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Config.hpp>

Inheritance diagram for Slic3r::ConfigOptionString:
Collaboration diagram for Slic3r::ConfigOptionString:

Public Member Functions

 ConfigOptionString ()
 ConfigOptionString (std::string value)
ConfigOptionType type () const override
ConfigOption * clone () const override
ConfigOptionString & operator= (const ConfigOption *opt)
bool operator== (const ConfigOptionString &rhs) const throw ()
bool operator< (const ConfigOptionString &rhs) const throw ()
bool empty () const
std::string serialize () const override
bool deserialize (const std::string &str, bool append=false) override
 operator std::string () const
void set (const ConfigOption *rhs) override
bool operator== (const ConfigOption &rhs) const override
bool operator!= (const std::string &rhs) const throw ()
bool operator!= (const ConfigOption &rhs) const
bool operator< (const std::string &rhs) const throw ()
size_t hash () const override throw ()
virtual int getInt () const
virtual double getFloat () const
virtual bool getBool () const
virtual void setInt (int)
bool is_scalar () const
bool is_vector () const
virtual bool nullable () const
virtual bool is_nil () const
virtual bool overriden_by (const ConfigOption *rhs) const
virtual bool apply_override (const ConfigOption *rhs, std::vector< int > &default_index)

Static Public Member Functions

static ConfigOptionType static_type ()

Public Attributes

std::string value

Private Member Functions

template<class Archive>
void serialize (Archive &ar)

Friends

class cereal::access

Detailed Description

Constructor & Destructor Documentation

◆ ConfigOptionString() [1/2]

Slic3r::ConfigOptionString::ConfigOptionString ( )
inline
1160: ConfigOptionSingle<std::string>(std::string{}) {}
ConfigOptionSingle(std::string value)
Definition Config.hpp:330

References Slic3r::ConfigOptionSingle< std::string >::ConfigOptionSingle(), and Slic3r::ConfigOptionSingle< std::string >::operator std::string().

Referenced by clone(), operator<(), operator=(), and operator==().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ConfigOptionString() [2/2]

Slic3r::ConfigOptionString::ConfigOptionString ( std::string value)
inlineexplicit
std::string value
Definition Config.hpp:329

References Slic3r::ConfigOptionSingle< std::string >::ConfigOptionSingle(), Slic3r::ConfigOptionSingle< std::string >::operator std::string(), and Slic3r::ConfigOptionSingle< std::string >::value.

Here is the call graph for this function:

Member Function Documentation

◆ apply_override()

virtual bool Slic3r::ConfigOption::apply_override ( const ConfigOption * rhs,
std::vector< int > & default_index )
inlinevirtualinherited
314 {
315 if (*this == *rhs)
316 return false;
317 *this = *rhs;
318 return true;
319 }
Definition Config.hpp:327

◆ clone()

ConfigOption * Slic3r::ConfigOptionString::clone ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1165{ return new ConfigOptionString(*this); }
ConfigOptionString()
Definition Config.hpp:1160

References ConfigOptionString().

Here is the call graph for this function:

◆ deserialize()

bool Slic3r::ConfigOptionString::deserialize ( const std::string & str,
bool append = false )
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1178 {
1179 UNUSED(append);
1180 return unescape_string_cstyle(str, this->value);
1181 }
#define UNUSED(x)
Definition libslic3r.h:112
void append(std::vector< T, Alloc > &dest, const std::vector< T, Alloc2 > &src)
Definition libslic3r.h:157
bool unescape_string_cstyle(const std::string &str, std::string &str_out)
Definition Config.cpp:150

References Slic3r::append(), Slic3r::unescape_string_cstyle(), and UNUSED.

Here is the call graph for this function:

◆ empty()

bool Slic3r::ConfigOptionString::empty ( ) const
inline
1170{ return this->value.empty(); }

Referenced by anonymous_namespace{OrcaSlicer_profile_validator.cpp}::preset_templates(), Slic3r::CLI::run(), and Slic3r::PresetCollection::set_custom_preset_alias().

Here is the caller graph for this function:

◆ getBool()

virtual bool Slic3r::ConfigOption::getBool ( ) const
inlinevirtualinherited
296{ throw BadOptionTypeException("Calling ConfigOption::getBool on a non-boolean ConfigOption"); }

◆ getFloat()

virtual double Slic3r::ConfigOption::getFloat ( ) const
inlinevirtualinherited
295{ throw BadOptionTypeException("Calling ConfigOption::getFloat on a non-float ConfigOption"); }

◆ getInt()

virtual int Slic3r::ConfigOption::getInt ( ) const
inlinevirtualinherited
294{ throw BadOptionTypeException("Calling ConfigOption::getInt on a non-int ConfigOption"); }

◆ hash()

size_t Slic3r::ConfigOptionSingle< std::string >::hash ( ) const
throw ( )
inlineoverridevirtualinherited

Implements Slic3r::ConfigOption.

353{ return std::hash<T>{}(this->value); }

◆ is_nil()

virtual bool Slic3r::ConfigOption::is_nil ( ) const
inlinevirtualinherited
306{ return false; }

◆ is_scalar()

bool Slic3r::ConfigOption::is_scalar ( ) const
inlineinherited
301{ return (int(this->type()) & int(coVectorType)) == 0; }
virtual ConfigOptionType type() const=0

◆ is_vector()

bool Slic3r::ConfigOption::is_vector ( ) const
inlineinherited
302{ return ! this->is_scalar(); }
bool is_scalar() const
Definition Config.hpp:301

◆ nullable()

virtual bool Slic3r::ConfigOption::nullable ( ) const
inlinevirtualinherited
304{ return false; }

◆ operator std::string()

Slic3r::ConfigOptionSingle< std::string >::operator std::string ( ) const
inlineinherited
331{ return this->value; }

Referenced by Slic3r::ConfigOptionString::ConfigOptionString(), and Slic3r::ConfigOptionString::ConfigOptionString().

Here is the caller graph for this function:

◆ operator!=() [1/2]

bool Slic3r::ConfigOption::operator!= ( const ConfigOption & rhs) const
inlineinherited
299{ return ! (*this == rhs); }

◆ operator!=() [2/2]

bool Slic3r::ConfigOptionSingle< std::string >::operator!= ( const std::string & rhs) const
throw ( )
inlineinherited
350{ return this->value != rhs; }

◆ operator<() [1/2]

bool Slic3r::ConfigOptionSingle< std::string >::operator< ( const std::string & rhs) const
throw ( )
inlineinherited
351{ return this->value < rhs; }

◆ operator<() [2/2]

bool Slic3r::ConfigOptionString::operator< ( const ConfigOptionString & rhs) const
throw ( )
inline
1169{ return this->value < rhs.value; }

References ConfigOptionString().

Here is the call graph for this function:

◆ operator=()

ConfigOptionString & Slic3r::ConfigOptionString::operator= ( const ConfigOption * opt)
inline
1166{ this->set(opt); return *this; }
void set(const ConfigOption *rhs) override
Definition Config.hpp:333

References ConfigOptionString(), and Slic3r::ConfigOptionSingle< std::string >::set().

Here is the call graph for this function:

◆ operator==() [1/2]

bool Slic3r::ConfigOptionSingle< std::string >::operator== ( const ConfigOption & rhs) const
inlineoverridevirtualinherited

Implements Slic3r::ConfigOption.

342 {
343 if (rhs.type() != this->type())
344 throw ConfigurationError("ConfigOptionSingle: Comparing incompatible types");
345 assert(dynamic_cast<const ConfigOptionSingle<T>*>(&rhs));
346 return this->value == static_cast<const ConfigOptionSingle<T>*>(&rhs)->value;
347 }

◆ operator==() [2/2]

bool Slic3r::ConfigOptionString::operator== ( const ConfigOptionString & rhs) const
throw ( )
inline
1168{ return this->value == rhs.value; }

References ConfigOptionString().

Here is the call graph for this function:

◆ overriden_by()

virtual bool Slic3r::ConfigOption::overriden_by ( const ConfigOption * rhs) const
inlinevirtualinherited
309 {
310 assert(! this->nullable() && ! rhs->nullable());
311 return *this != *rhs;
312 }
virtual bool nullable() const
Definition Config.hpp:304

◆ serialize() [1/2]

std::string Slic3r::ConfigOptionString::serialize ( ) const
inlineoverridevirtual

Reimplemented from Slic3r::ConfigOptionSingle< std::string >.

1173 {
1174 return escape_string_cstyle(this->value);
1175 }
std::string escape_string_cstyle(const std::string &str)
Definition Config.cpp:76

References Slic3r::escape_string_cstyle().

Here is the call graph for this function:

◆ serialize() [2/2]

template<class Archive>
void Slic3r::ConfigOptionString::serialize ( Archive & ar)
inlineprivate
1185{ ar(cereal::base_class<ConfigOptionSingle<std::string>>(this)); }

References Slic3r::ConfigOptionSingle< std::string >::ConfigOptionSingle().

Here is the call graph for this function:

◆ set()

void Slic3r::ConfigOptionSingle< std::string >::set ( const ConfigOption * rhs)
inlineoverridevirtualinherited

Implements Slic3r::ConfigOption.

334 {
335 if (rhs->type() != this->type())
336 throw ConfigurationError("ConfigOptionSingle: Assigning an incompatible type");
337 assert(dynamic_cast<const ConfigOptionSingle<T>*>(rhs));
338 this->value = static_cast<const ConfigOptionSingle<T>*>(rhs)->value;
339 }

Referenced by Slic3r::ConfigOptionString::operator=().

Here is the caller graph for this function:

◆ setInt()

virtual void Slic3r::ConfigOption::setInt ( int )
inlinevirtualinherited
297{ throw BadOptionTypeException("Calling ConfigOption::setInt on a non-int ConfigOption"); }

◆ static_type()

ConfigOptionType Slic3r::ConfigOptionString::static_type ( )
inlinestatic
1163{ return coString; }
@ coString
Definition Config.hpp:192

References Slic3r::coString.

Referenced by type().

Here is the caller graph for this function:

◆ type()

ConfigOptionType Slic3r::ConfigOptionString::type ( ) const
inlineoverridevirtual

Implements Slic3r::ConfigOption.

1164{ return static_type(); }
static ConfigOptionType static_type()
Definition Config.hpp:1163

References static_type().

Here is the call graph for this function:

◆ cereal::access

friend class cereal::access
friend

References cereal::access.

Referenced by cereal::access.

Member Data Documentation

◆ value

std::string Slic3r::ConfigOptionSingle< std::string >::value
inherited

The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Config.hpp