SILVERCODERS DocToText  4.0.1512
Converts DOC, XLS, XLSB, PPT, RTF, ODF (ODT, ODS, ODP), OOXML (DOCX, XLSX, PPTX), iWork (PAGES, NUMBERS, KEYNOTE), ODFXML (FODP, FODS, FODT), PDF, EML and HTML documents to plain text. Extracts metadata and annotations.
 All Classes Functions Enumerations Pages
Public Member Functions | List of all members
doctotext::Variant Class Reference

#include <variant.h>

Public Member Functions

 Variant ()
 Creates uninitialized object (represents null)
 
 Variant (const std::string &value)
 Creates object which represents string.
 
 Variant (const tm &value)
 Creates object which represents date.
 
 Variant (size_t value)
 Creates object which represents unsigned number.
 
 Variant (const Variant &variant)
 Creates a copy of another Variant.
 
Variantoperator= (const Variant &variant)
 
void setValue (size_t number)
 Sets unsigned number value. From this moment, Variant represents unsigned number.
 
void setValue (const tm &date_time)
 Sets date value. From this moment, Variant represents date.
 
void setValue (const std::string &str)
 Sets string value. From this moment, Variant represents string.
 
bool isEmpty () const
 If Variant has not been initialized with number/date/string, this method returns value true.
 
bool isString () const
 Checks if Variant represents a string.
 
bool isNumber () const
 Checks if Variant represents a number.
 
bool isDateTime () const
 Checks if Variant represents a date.
 
const tm & getDateTime () const
 
const char * getString () const
 
size_t getNumber () const
 

Detailed Description

Variant is an object which can represent unsigned number, date or string. Uninitialized object represents 'null'.

Member Function Documentation

const tm& doctotext::Variant::getDateTime ( ) const

If Variant is a date, this method returns const reference to tm object. But if it is not a date, struct tm can be filled with undefined numbers (usually zeros)

size_t doctotext::Variant::getNumber ( ) const

If Variant is a number, then number which is inside this object is returned. In other cases, returned number may be undefined (usually 0).

const char* doctotext::Variant::getString ( ) const

Returns string value. If Variant is a string, then string is returned (simple). But if variant represents number or a date, proper value is converted to the string. If variant has no value (represents null), empty string is returned.


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