MySQL++ SSQLS v2 Translator
3.2.5
|
Base class for known SSQLS v2 'option' directives. More...
#include <parsev2.h>
Public Member Functions | |
virtual | ~Option () |
Virtual dtor, since this is a base class. | |
![]() | |
virtual | ~Line () |
Virtual dtor, since this is a base class. | |
virtual void | print (std::ostream &os) const =0 |
Print line's contents out to a stream in SSQLS v2 form. | |
Static Public Member Functions | |
static Option * | parse (const StringList &tl, bool subdirective, const File &file) |
Attempt to create an Option object from information in the passed StringList. More... | |
![]() | |
static Line * | parse (const StringList &tl, bool subdirective, const File &file) |
Virtual ctor, creating one of our subclass objects based on what we're passed. More... | |
Protected Member Functions | |
Option (const std::string &value) | |
Protected ctor, so we cannot be directly instantiated. More... | |
const char * | value () const |
Return the option's value in string form, unmodified from the original parse. More... | |
![]() | |
Line () | |
Protected ctor, to prevent instantiation. | |
Static Protected Member Functions | |
static bool | parse_bool (const std::string &value) |
Convert a string expressing a boolean value to a bool . More... | |
Base class for known SSQLS v2 'option' directives.
There are subclasses for all known SSQLS v2 options, having the same name, but with different capitalization and an "Option" suffix.
|
inlineprotected |
Protected ctor, so we cannot be directly instantiated.
value | the option's value |
|
static |
Attempt to create an Option object from information in the passed StringList.
This is a kind of pre-processor for the Option subclass's ctors, creating an object of one of those subclasses only if the given StringList makes sense, passing those values as ctor parameters.
References ParseV2::File::parse_error().
Referenced by ParseV2::Line::parse().
|
staticprotected |
Convert a string expressing a boolean value to a bool
.
If we cannot recognize the value, we return true because SSQLS v2 options all default to false. The assumption is is that if the option directive is present, the value is most likely truthy.
As a consequence, the only thing this function recognizes is "0", "false", "no", and "off", with any mix of upper and lower case. All else is considered true
.
|
inlineprotected |
Return the option's value in string form, unmodified from the original parse.
Subclasses typically either expose this function in their public interface with a different, more appropriate name, or they define a wholly different method returning a reduced or more type-safe version of this value.
Referenced by ParseV2::HeaderExtensionOption::extension(), and ParseV2::ImplementationExtensionOption::extension().