2012-01-12 01:24:08 +01:00
|
|
|
/*
|
2012-01-12 03:46:16 +01:00
|
|
|
* This file is a part of PikoTools
|
2012-01-12 01:24:08 +01:00
|
|
|
* and is distributed under the (new) BSD licence.
|
|
|
|
* Author: Tomasz Sowa <t.sowa@ttmath.org>
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*
|
2022-05-30 00:55:38 +02:00
|
|
|
* Copyright (c) 2008-2022, Tomasz Sowa
|
2012-01-12 01:24:08 +01:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions are met:
|
|
|
|
*
|
|
|
|
* * Redistributions of source code must retain the above copyright notice,
|
|
|
|
* this list of conditions and the following disclaimer.
|
|
|
|
*
|
|
|
|
* * Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* * Neither the name Tomasz Sowa nor the names of contributors to this
|
|
|
|
* project may be used to endorse or promote products derived
|
|
|
|
* from this software without specific prior written permission.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
|
|
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
|
|
|
* LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
|
|
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
|
|
|
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
|
|
|
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
|
|
|
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
|
|
|
|
* THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <wchar.h>
|
2012-01-12 03:46:16 +01:00
|
|
|
#include "space.h"
|
2012-01-12 01:24:08 +01:00
|
|
|
#include "utf8/utf8.h"
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
#include "convert/convert.h"
|
2012-01-12 01:24:08 +01:00
|
|
|
|
|
|
|
|
2021-05-20 16:11:12 +02:00
|
|
|
namespace pt
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
|
|
|
|
|
|
|
Space::Space()
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(const Space & space)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-17 18:09:47 +01:00
|
|
|
copy_from(space);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space::Space(Space && space)
|
|
|
|
{
|
|
|
|
initialize();
|
|
|
|
move_from(std::move(space));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::operator=(const Space & space)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-17 18:09:47 +01:00
|
|
|
copy_from(space);
|
2021-03-15 19:36:49 +01:00
|
|
|
return *this;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::operator=(Space && space)
|
|
|
|
{
|
|
|
|
move_from(std::move(space));
|
|
|
|
return *this;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::~Space()
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value();
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(bool val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(short val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(int val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(long val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(long long val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(unsigned short val)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(unsigned int val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(unsigned long val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(unsigned long long val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(float val)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(double val)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(val);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
Space::Space(long double val)
|
|
|
|
{
|
|
|
|
initialize();
|
|
|
|
set(val);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(const char * str)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(str);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(const wchar_t * str)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(str);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(const std::string & str)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(str);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(const std::wstring & str)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(str);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::Space(const Space * space)
|
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
initialize();
|
2021-03-15 19:36:49 +01:00
|
|
|
set(space);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
2021-11-05 09:27:32 +01:00
|
|
|
Space::Space(const Date & date)
|
|
|
|
{
|
|
|
|
initialize();
|
|
|
|
set(date);
|
|
|
|
}
|
|
|
|
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-16 18:36:59 +01:00
|
|
|
void Space::clear()
|
|
|
|
{
|
|
|
|
set_null();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-05-21 17:13:11 +02:00
|
|
|
size_t Space::str_size() const
|
|
|
|
{
|
|
|
|
if( is_str() )
|
|
|
|
{
|
|
|
|
return value.value_string.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
size_t Space::wstr_size() const
|
|
|
|
{
|
|
|
|
if( is_wstr() )
|
|
|
|
{
|
|
|
|
return value.value_wstring.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
size_t Space::object_size() const
|
|
|
|
{
|
|
|
|
if( is_object() )
|
|
|
|
{
|
|
|
|
return value.value_object.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
size_t Space::table_size() const
|
|
|
|
{
|
|
|
|
if( is_table() )
|
|
|
|
{
|
|
|
|
return value.value_table.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-16 18:36:59 +01:00
|
|
|
void Space::set_null()
|
|
|
|
{
|
|
|
|
initialize_value_null_if_needed();
|
|
|
|
}
|
|
|
|
|
2021-05-17 03:08:32 +02:00
|
|
|
|
2021-03-16 18:36:59 +01:00
|
|
|
void Space::set_empty_string()
|
|
|
|
{
|
2021-05-17 03:08:32 +02:00
|
|
|
if( type == type_string )
|
|
|
|
{
|
|
|
|
value.value_string.clear();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_string_if_needed();
|
|
|
|
}
|
2021-03-16 18:36:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Space::set_empty_wstring()
|
|
|
|
{
|
2021-05-17 03:08:32 +02:00
|
|
|
if( type == type_wstring )
|
|
|
|
{
|
|
|
|
value.value_wstring.clear();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_wstring_if_needed();
|
|
|
|
}
|
2021-03-16 18:36:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Space::set_empty_table()
|
|
|
|
{
|
2021-05-17 03:08:32 +02:00
|
|
|
if( type == type_table )
|
|
|
|
{
|
2021-06-27 15:41:38 +02:00
|
|
|
remove_value_table(true);
|
2021-05-17 03:08:32 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_table_if_needed();
|
|
|
|
}
|
2021-03-16 18:36:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void Space::set_empty_object()
|
|
|
|
{
|
2021-05-17 03:08:32 +02:00
|
|
|
if( type == type_object )
|
|
|
|
{
|
2021-06-27 15:41:38 +02:00
|
|
|
remove_value_object(true);
|
2021-05-17 03:08:32 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_object_if_needed();
|
|
|
|
}
|
2021-03-16 18:36:59 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-12-07 12:35:12 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(bool val)
|
2018-05-25 19:12:28 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
initialize_value_bool_if_needed();
|
|
|
|
value.value_bool = val;
|
2018-05-25 19:12:28 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(short val)
|
2018-05-25 19:12:28 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
set(static_cast<long long>(val));
|
2018-05-25 19:12:28 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(int val)
|
2018-05-25 19:12:28 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
set(static_cast<long long>(val));
|
2018-05-25 19:12:28 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(long val)
|
|
|
|
{
|
|
|
|
set(static_cast<long long>(val));
|
|
|
|
}
|
2018-05-25 19:12:28 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(long long val)
|
2018-05-25 19:12:28 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
initialize_value_long_if_needed();
|
|
|
|
value.value_long = val;
|
|
|
|
}
|
2018-05-25 19:12:28 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(unsigned short val)
|
|
|
|
{
|
|
|
|
set(static_cast<long long>(val));
|
|
|
|
}
|
2018-05-25 19:12:28 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(unsigned int val)
|
|
|
|
{
|
|
|
|
set(static_cast<long long>(val));
|
2018-05-25 19:12:28 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(unsigned long val)
|
|
|
|
{
|
|
|
|
set(static_cast<long long>(val));
|
|
|
|
}
|
2018-05-25 19:12:28 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(unsigned long long val)
|
|
|
|
{
|
|
|
|
set(static_cast<long long>(val));
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(float val)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
initialize_value_float_if_needed();
|
|
|
|
value.value_float = val;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(double val)
|
|
|
|
{
|
|
|
|
initialize_value_double_if_needed();
|
|
|
|
value.value_double = val;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
void Space::set(long double val)
|
|
|
|
{
|
|
|
|
initialize_value_long_double_if_needed();
|
|
|
|
value.value_long_double = val;
|
|
|
|
}
|
|
|
|
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(const char * str)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-16 18:36:59 +01:00
|
|
|
if( str == nullptr )
|
|
|
|
{
|
|
|
|
initialize_value_null_if_needed();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_string_if_needed();
|
|
|
|
value.value_string = str;
|
|
|
|
}
|
2021-03-15 19:36:49 +01:00
|
|
|
}
|
2017-06-27 18:51:55 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(const wchar_t * str)
|
|
|
|
{
|
2021-03-16 18:36:59 +01:00
|
|
|
if( str == nullptr )
|
|
|
|
{
|
|
|
|
initialize_value_null_if_needed();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_wstring_if_needed();
|
|
|
|
value.value_wstring = str;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(const std::string & str)
|
|
|
|
{
|
|
|
|
initialize_value_string_if_needed();
|
|
|
|
value.value_string = str;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(const std::wstring & str)
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
initialize_value_wstring_if_needed();
|
|
|
|
value.value_wstring = str;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::set(const Space & space)
|
|
|
|
{
|
|
|
|
copy_from(space);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::set(const Space * space)
|
2012-06-27 01:20:59 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( space == nullptr )
|
2012-06-27 01:20:59 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
initialize_value_null_if_needed();
|
2012-06-27 01:20:59 +02:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-03-17 18:09:47 +01:00
|
|
|
copy_from(*space);
|
2012-06-27 01:20:59 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::set(Space && space)
|
|
|
|
{
|
|
|
|
move_from(std::move(space));
|
|
|
|
}
|
|
|
|
|
2021-11-05 09:27:32 +01:00
|
|
|
void Space::set(const Date & date)
|
|
|
|
{
|
|
|
|
initialize_value_wstring_if_needed();
|
|
|
|
WTextStream str;
|
|
|
|
date.SerializeISO(str);
|
|
|
|
str.to_str(value.value_wstring);
|
|
|
|
}
|
2021-05-19 22:24:53 +02:00
|
|
|
|
2012-06-27 01:20:59 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(bool val)
|
2012-10-17 21:55:16 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
2012-10-17 21:55:16 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(short val)
|
2012-10-17 21:55:16 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
2012-10-17 21:55:16 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(int val)
|
2012-10-17 21:55:16 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
2012-10-17 21:55:16 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(long val)
|
2012-10-17 21:55:16 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
2012-10-17 21:55:16 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(long long val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
2012-10-17 21:55:16 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(unsigned short val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
2012-10-17 21:55:16 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(unsigned int val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
2012-10-17 21:55:16 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(unsigned long val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
2012-10-17 21:55:16 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(unsigned long long val)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(float val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(double val)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
Space & Space::add(long double val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const char * val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const std::string & val)
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(val);
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const std::wstring & val)
|
|
|
|
{
|
|
|
|
return add_generic(val);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::add(const Space & space)
|
|
|
|
{
|
|
|
|
return add_generic(space);
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const Space * space)
|
|
|
|
{
|
|
|
|
return add_generic(space);
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::add(Space && space)
|
|
|
|
{
|
|
|
|
initialize_value_table_if_needed();
|
|
|
|
Space * new_space = new Space(std::move(space));
|
|
|
|
value.value_table.push_back(new_space);
|
|
|
|
return *value.value_table.back();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-11-05 09:27:32 +01:00
|
|
|
Space & Space::add(const Date & date)
|
|
|
|
{
|
|
|
|
return add_generic(date);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
Space & Space::add_empty_space()
|
|
|
|
{
|
|
|
|
return add_generic(static_cast<Space*>(nullptr));
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, bool val)
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, short val)
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, int val)
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, long val)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, long long val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, unsigned short val)
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, unsigned int val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, unsigned long val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, unsigned long long val)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, float val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, double val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
Space & Space::add(const wchar_t * field, long double val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, const char * val)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, const wchar_t * val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, const std::string & val)
|
2017-12-07 12:35:12 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
2017-12-07 12:35:12 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, const std::wstring & val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
2017-12-07 12:35:12 +01:00
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::add(const wchar_t * field, const Space & space)
|
|
|
|
{
|
|
|
|
return add_generic(field, space);
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add(const wchar_t * field, const Space * space)
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return add_generic(field, space);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::add(const wchar_t * field, Space && space)
|
|
|
|
{
|
|
|
|
initialize_value_object_if_needed();
|
|
|
|
auto insert_res = value.value_object.insert(std::make_pair(field, nullptr));
|
2021-06-27 15:41:38 +02:00
|
|
|
|
|
|
|
if( insert_res.second )
|
|
|
|
{
|
|
|
|
insert_res.first->second = new Space(std::move(space));
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
insert_res.first->second->set(std::move(space));
|
|
|
|
}
|
2021-05-19 22:24:53 +02:00
|
|
|
|
|
|
|
return *(insert_res.first->second);
|
|
|
|
}
|
|
|
|
|
2021-11-05 09:27:32 +01:00
|
|
|
|
|
|
|
Space & Space::add(const wchar_t * field, const Date & date)
|
|
|
|
{
|
|
|
|
return add_generic(field, date);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space & Space::add_empty_space(const wchar_t * field)
|
|
|
|
{
|
|
|
|
return add_generic(field, static_cast<Space*>(nullptr));
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, bool val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, short val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, int val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, long val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, long long val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, unsigned short val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, unsigned int val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, unsigned long val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, unsigned long long val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, float val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, double val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
Space & Space::add(const std::wstring & field, long double val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
Space & Space::add(const std::wstring & field, const char * val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, const wchar_t * val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, const std::string & val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
|
|
|
Space & Space::add(const std::wstring & field, const std::wstring & val)
|
|
|
|
{
|
|
|
|
return add_generic(field, val);
|
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::add(const std::wstring & field, const Space & space)
|
|
|
|
{
|
|
|
|
return add_generic(field, space);
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
Space & Space::add(const std::wstring & field, const Space * space)
|
|
|
|
{
|
|
|
|
return add_generic(field, space);
|
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
Space & Space::add(const std::wstring & field, Space && space)
|
|
|
|
{
|
|
|
|
return add(field.c_str(), std::move(space));
|
|
|
|
}
|
|
|
|
|
2021-11-05 09:27:32 +01:00
|
|
|
Space & Space::add(const std::wstring & field, const Date & date)
|
|
|
|
{
|
|
|
|
return add_generic(field, date);
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
Space & Space::add_empty_space(const std::wstring & field)
|
|
|
|
{
|
|
|
|
return add_generic(field, static_cast<Space*>(nullptr));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_null() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_null;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_bool() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_bool;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_llong() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return is_long_long();
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_long_long() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_long;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_float() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_float;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_double() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_double;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
bool Space::is_long_double() const
|
|
|
|
{
|
|
|
|
return type == type_long_double;
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_numeric() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
return is_long_long() || is_float() || is_double() || is_long_double();
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_str() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_string;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_wstr() const
|
|
|
|
{
|
|
|
|
return type == type_wstring;
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_text() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return is_str() || is_wstr();
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_object() const
|
|
|
|
{
|
|
|
|
return type == type_object;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::is_table() const
|
|
|
|
{
|
|
|
|
return type == type_table;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool Space::to_bool() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
if( type == type_bool )
|
|
|
|
return value.value_bool;
|
|
|
|
|
2021-10-20 08:30:57 +02:00
|
|
|
if( type == type_long )
|
|
|
|
return value.value_long != 0;
|
|
|
|
|
|
|
|
if( type == type_float )
|
|
|
|
return value.value_float != 0.0f;
|
|
|
|
|
|
|
|
if( type == type_double )
|
|
|
|
return value.value_double != 0.0;
|
|
|
|
|
|
|
|
if( type == type_long_double )
|
|
|
|
return value.value_long_double != 0.0L;
|
|
|
|
|
|
|
|
if( type == type_string )
|
|
|
|
return !value.value_string.empty();
|
|
|
|
|
|
|
|
if( type == type_wstring )
|
|
|
|
return !value.value_wstring.empty();
|
|
|
|
|
|
|
|
if( type == type_table )
|
|
|
|
return !value.value_table.empty();
|
|
|
|
|
|
|
|
if( type == type_object )
|
|
|
|
return !value.value_object.empty();
|
|
|
|
|
|
|
|
return false;
|
2021-03-15 19:36:49 +01:00
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
short Space::to_short() const
|
|
|
|
{
|
|
|
|
return to_generic_numeric_signed_value<short>();
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
int Space::to_int() const
|
|
|
|
{
|
|
|
|
return to_generic_numeric_signed_value<int>();
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
long Space::to_long() const
|
|
|
|
{
|
|
|
|
return to_generic_numeric_signed_value<long>();
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
long long Space::to_llong() const
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return to_long_long();
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
long long Space::to_long_long() const
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
case type_object:
|
|
|
|
case type_table:
|
|
|
|
return 0;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_bool:
|
|
|
|
return value.value_bool ? 1 : 0;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_long:
|
|
|
|
return value.value_long;
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_float:
|
|
|
|
return static_cast<long long>(value.value_float);
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_double:
|
|
|
|
return static_cast<long long>(value.value_double);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
case type_long_double:
|
|
|
|
return static_cast<long long>(value.value_long_double);
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_string:
|
|
|
|
return convert_string_to_long_long();
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_wstring:
|
|
|
|
return convert_wstring_to_long_long();
|
|
|
|
}
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
return 0;
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
unsigned long long Space::to_ullong() const
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return to_ulong_long();
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
|
|
|
|
long long Space::convert_string_to_long_long() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
bool was_overflow = false;
|
|
|
|
const char * after_str;
|
|
|
|
long long val = Toll(value.value_string.c_str(), 10, &after_str, &was_overflow, true);
|
|
|
|
|
|
|
|
return was_overflow ? 0 : val;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
long long Space::convert_wstring_to_long_long() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
bool was_overflow = false;
|
|
|
|
const wchar_t * after_str;
|
|
|
|
long long val = Toll(value.value_wstring.c_str(), 10, &after_str, &was_overflow, true);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
return was_overflow ? 0 : val;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
unsigned long long Space::convert_string_to_ulong_long() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
bool was_overflow = false;
|
|
|
|
const char * after_str;
|
|
|
|
unsigned long long val = Toull(value.value_string.c_str(), 10, &after_str, &was_overflow, true);
|
|
|
|
|
|
|
|
return was_overflow ? 0 : val;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
unsigned long long Space::convert_wstring_to_ulong_long() const
|
|
|
|
{
|
|
|
|
bool was_overflow = false;
|
|
|
|
const wchar_t * after_str;
|
|
|
|
unsigned long long val = Toull(value.value_wstring.c_str(), 10, &after_str, &was_overflow, true);
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
return was_overflow ? 0 : val;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
|
|
|
|
unsigned short Space::to_ushort() const
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return to_generic_numeric_unsigned_value<unsigned short>();
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
unsigned int Space::to_uint() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return to_generic_numeric_unsigned_value<unsigned int>();
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
unsigned long Space::to_ulong() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return to_generic_numeric_unsigned_value<unsigned long>();
|
|
|
|
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
unsigned long long Space::to_ulong_long() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
case type_object:
|
|
|
|
case type_table:
|
|
|
|
return 0;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_bool:
|
|
|
|
return value.value_bool ? 1 : 0;
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_long:
|
|
|
|
return static_cast<unsigned long long>(value.value_long);
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_float:
|
|
|
|
return static_cast<unsigned long long>(value.value_float);
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_double:
|
|
|
|
return static_cast<unsigned long long>(value.value_double);
|
2012-01-12 01:24:08 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
case type_long_double:
|
|
|
|
return static_cast<unsigned long long>(value.value_long_double);
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_string:
|
|
|
|
return convert_string_to_ulong_long();
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_wstring:
|
|
|
|
return convert_wstring_to_ulong_long();
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
added: functions for dealing with white characters:
bool IsWhite(wchar_t c, bool check_additional_chars, bool treat_new_line_as_white) (checking unicode white characters too)
CharType * SkipWhite(CharType * str, bool check_additional_chars = true, bool treat_new_line_as_white = true)
IsDigit(wchar_t c, int base, int * digit)
added: functions to converting from a string to an integer:
unsigned long long Toull(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long long Toll(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned long Toul(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
unsigned int Toui(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
long Tol(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
int Toi(const CharType * str, int base = 10, const CharType ** after_str = 0, bool * was_overflow = 0)
changed: some work in Space (new Api)
now Text() methods returns std::wstring by value (before they were returned by reference)
added std::wstring & TextRef() methods
added unsigned int UInt(), unsigned long ULong() and LongLong() and ULongLong()
GetValue() renamed to GetFirstValue()
AText() renamed to TextA() and they return std::string by value now
git-svn-id: svn://ttmath.org/publicrep/pikotools/trunk@1066 e52654a7-88a9-db11-a3e9-0013d4bc506e
2017-12-05 17:32:21 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
float Space::to_float() const
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
case type_object:
|
|
|
|
case type_table:
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case type_bool:
|
|
|
|
return value.value_bool ? 1.0f : 0.0f;
|
|
|
|
|
|
|
|
case type_long:
|
|
|
|
return static_cast<float>(value.value_long);
|
|
|
|
|
|
|
|
case type_float:
|
|
|
|
return value.value_float;
|
|
|
|
|
|
|
|
case type_double:
|
|
|
|
return static_cast<float>(value.value_double);
|
|
|
|
|
|
|
|
case type_long_double:
|
|
|
|
return static_cast<float>(value.value_long_double);
|
|
|
|
|
|
|
|
case type_string:
|
|
|
|
return pt::to_float(value.value_string);
|
|
|
|
|
|
|
|
case type_wstring:
|
|
|
|
return pt::to_float(value.value_wstring);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
double Space::to_double() const
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
case type_object:
|
|
|
|
case type_table:
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case type_bool:
|
|
|
|
return value.value_bool ? 1.0 : 0.0;
|
|
|
|
|
|
|
|
case type_long:
|
|
|
|
return static_cast<double>(value.value_long);
|
|
|
|
|
|
|
|
case type_float:
|
|
|
|
return static_cast<double>(value.value_float);
|
|
|
|
|
|
|
|
case type_double:
|
|
|
|
return value.value_double;
|
|
|
|
|
|
|
|
case type_long_double:
|
|
|
|
return static_cast<double>(value.value_long_double);
|
|
|
|
|
|
|
|
case type_string:
|
|
|
|
return pt::to_double(value.value_string);
|
|
|
|
|
|
|
|
case type_wstring:
|
|
|
|
return pt::to_double(value.value_wstring);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long double Space::to_long_double() const
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
case type_object:
|
|
|
|
case type_table:
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case type_bool:
|
|
|
|
return value.value_bool ? 1.0 : 0.0;
|
|
|
|
|
|
|
|
case type_long:
|
|
|
|
return static_cast<long double>(value.value_long);
|
|
|
|
|
|
|
|
case type_float:
|
|
|
|
return static_cast<long double>(value.value_float);
|
|
|
|
|
|
|
|
case type_double:
|
|
|
|
return static_cast<long double>(value.value_double);
|
|
|
|
|
|
|
|
case type_long_double:
|
|
|
|
return value.value_long_double;
|
|
|
|
|
|
|
|
case type_string:
|
|
|
|
return pt::to_long_double(value.value_string);
|
|
|
|
|
|
|
|
case type_wstring:
|
|
|
|
return pt::to_long_double(value.value_wstring);
|
|
|
|
}
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
std::string Space::to_str() const
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type == type_string )
|
|
|
|
return value.value_string;
|
|
|
|
|
|
|
|
std::string str;
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type == type_wstring )
|
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
TextStream stream;
|
2021-06-14 13:48:32 +02:00
|
|
|
serialize_string_buffer(value.value_wstring.c_str(), value.value_wstring.size(), stream, Escape::no_escape);
|
2021-06-20 16:46:08 +02:00
|
|
|
stream.to_str(str);
|
2021-03-15 19:36:49 +01:00
|
|
|
return str;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
serialize_to_json_to(str);
|
|
|
|
return str;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
std::wstring Space::to_wstr() const
|
2012-03-12 21:31:17 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type == type_wstring )
|
|
|
|
return value.value_wstring;
|
2012-03-12 21:31:17 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
std::wstring str;
|
2017-06-27 18:51:55 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type == type_string )
|
2012-03-12 21:31:17 +01:00
|
|
|
{
|
2021-05-21 00:24:56 +02:00
|
|
|
utf8_to_wide(value.value_string, str);
|
2021-03-15 19:36:49 +01:00
|
|
|
return str;
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
serialize_to_json_to(str);
|
|
|
|
return str;
|
2012-03-12 21:31:17 +01:00
|
|
|
}
|
|
|
|
|
2012-02-10 01:32:22 +01:00
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
to_list_str_generic(output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Space::to_list(std::list<std::wstring> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
to_list_wstr_generic(output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Space::to_list(std::vector<std::string> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
to_list_str_generic(output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Space::to_list(std::vector<std::wstring> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
to_list_wstr_generic(output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::to_bool(const wchar_t * field, bool default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_bool() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
short Space::to_short(const wchar_t * field, short default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_short() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Space::to_int(const wchar_t * field, int default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_int() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
long Space::to_long(const wchar_t * field, long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_long() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long Space::to_llong(const wchar_t * field, long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_llong() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long Space::to_long_long(const wchar_t * field, long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_long_long() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned short Space::to_ushort(const wchar_t * field, unsigned short default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ushort() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int Space::to_uint(const wchar_t * field, unsigned int default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_uint() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long Space::to_ulong(const wchar_t * field, unsigned long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ulong() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long long Space::to_ullong(const wchar_t * field, unsigned long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ullong() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long long Space::to_ulong_long(const wchar_t * field, unsigned long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ulong_long() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Space::to_str(const wchar_t * field, const char * default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->to_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( default_value )
|
|
|
|
{
|
|
|
|
return std::string(default_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::string();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::string Space::to_str(const wchar_t * field, const std::string & default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_str() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::wstring Space::to_wstr(const wchar_t * field, const wchar_t * default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->to_wstr();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( default_value )
|
|
|
|
{
|
|
|
|
return std::wstring(default_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::wstring();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::wstring Space::to_wstr(const wchar_t * field, const std::wstring & default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_wstr() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::to_list(const wchar_t * field, std::list<std::wstring> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::to_list(const std::wstring & field, std::list<std::string> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::to_list(const std::wstring & field, std::list<std::wstring> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::to_list(const wchar_t * field, std::vector<std::string> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::to_list(const wchar_t * field, std::vector<std::wstring> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::to_list(const std::wstring & field, std::vector<std::string> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::to_list(const std::wstring & field, std::vector<std::wstring> & output_list, bool clear_list) const
|
|
|
|
{
|
|
|
|
return to_list_generic(field, output_list, clear_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::to_bool(const std::wstring & field, bool default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_bool() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
short Space::to_short(const std::wstring & field, short default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_short() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
int Space::to_int(const std::wstring & field, int default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_int() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
long Space::to_long(const std::wstring & field, long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_long() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long Space::to_llong(const std::wstring & field, long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_llong() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long Space::to_long_long(const std::wstring & field, long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_long_long() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned short Space::to_ushort(const std::wstring & field, unsigned short default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ushort() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned int Space::to_uint(const std::wstring & field, unsigned int default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_uint() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long Space::to_ulong(const std::wstring & field, unsigned long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ulong() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long long Space::to_ullong(const std::wstring & field, unsigned long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ullong() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned long long Space::to_ulong_long(const std::wstring & field, unsigned long long default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_ulong_long() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Space::to_str(const std::wstring & field, const char * default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->to_str();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( default_value )
|
|
|
|
{
|
|
|
|
return std::string(default_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::string();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Space::to_str(const std::wstring & field, const std::string & default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_str() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
std::wstring Space::to_wstr(const std::wstring & field, const wchar_t * default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->to_wstr();
|
|
|
|
}
|
|
|
|
|
|
|
|
if( default_value )
|
|
|
|
{
|
|
|
|
return std::wstring(default_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
return std::wstring();
|
|
|
|
}
|
|
|
|
|
|
|
|
std::wstring Space::to_wstr(const std::wstring & field, const std::wstring & default_value) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->to_wstr() : default_value;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-18 15:33:43 +01:00
|
|
|
std::string Space::serialize_to_space_str(bool pretty_print) const
|
2012-03-12 21:31:17 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
std::string str;
|
2021-03-18 15:33:43 +01:00
|
|
|
serialize_to_space_to(str, pretty_print);
|
2021-03-15 19:36:49 +01:00
|
|
|
return str;
|
2012-03-12 21:31:17 +01:00
|
|
|
}
|
2012-02-12 19:54:06 +01:00
|
|
|
|
|
|
|
|
2021-03-18 15:33:43 +01:00
|
|
|
std::wstring Space::serialize_to_space_wstr(bool pretty_print) const
|
2012-07-25 12:27:20 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
std::wstring str;
|
2021-03-18 15:33:43 +01:00
|
|
|
serialize_to_space_to(str, pretty_print);
|
2021-03-15 19:36:49 +01:00
|
|
|
return str;
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
|
|
|
|
2012-07-25 12:27:20 +02:00
|
|
|
|
2021-03-18 15:33:43 +01:00
|
|
|
void Space::serialize_to_space_to(std::string & str, bool pretty_print) const
|
2021-03-15 19:36:49 +01:00
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
TextStream stream;
|
2021-03-18 15:33:43 +01:00
|
|
|
serialize_to_space_stream(stream, pretty_print);
|
2012-07-25 12:27:20 +02:00
|
|
|
|
2021-06-20 16:46:08 +02:00
|
|
|
stream.to_str(str);
|
2021-03-15 19:36:49 +01:00
|
|
|
}
|
2012-07-25 12:27:20 +02:00
|
|
|
|
|
|
|
|
2021-03-18 15:33:43 +01:00
|
|
|
void Space::serialize_to_space_to(std::wstring & str, bool pretty_print) const
|
2012-02-10 01:32:22 +01:00
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
WTextStream stream;
|
2021-03-18 15:33:43 +01:00
|
|
|
serialize_to_space_stream(stream, pretty_print);
|
2017-06-27 18:51:55 +02:00
|
|
|
|
2021-06-20 16:46:08 +02:00
|
|
|
stream.to_str(str);
|
2021-03-15 19:36:49 +01:00
|
|
|
}
|
2012-02-10 01:32:22 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
|
2021-08-07 21:19:38 +02:00
|
|
|
std::string Space::serialize_to_json_str(bool pretty_print) const
|
2021-03-15 19:36:49 +01:00
|
|
|
{
|
|
|
|
std::string str;
|
2021-08-07 21:19:38 +02:00
|
|
|
serialize_to_json_to(str, pretty_print);
|
2021-03-15 19:36:49 +01:00
|
|
|
return str;
|
2012-02-10 01:32:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-07 21:19:38 +02:00
|
|
|
std::wstring Space::serialize_to_json_wstr(bool pretty_print) const
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
std::wstring str;
|
2021-08-07 21:19:38 +02:00
|
|
|
serialize_to_json_to(str, pretty_print);
|
2021-03-15 19:36:49 +01:00
|
|
|
return str;
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2012-02-15 08:46:34 +01:00
|
|
|
|
2021-08-07 21:19:38 +02:00
|
|
|
void Space::serialize_to_json_to(std::string & str, bool pretty_print) const
|
2017-06-27 18:51:55 +02:00
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
TextStream stream;
|
2021-08-07 21:19:38 +02:00
|
|
|
serialize_to_json_stream(stream, pretty_print);
|
2021-03-15 19:36:49 +01:00
|
|
|
|
2021-06-20 16:46:08 +02:00
|
|
|
stream.to_str(str);
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-07 21:19:38 +02:00
|
|
|
void Space::serialize_to_json_to(std::wstring & str, bool pretty_print) const
|
2012-02-10 01:32:22 +01:00
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
WTextStream stream;
|
2021-08-07 21:19:38 +02:00
|
|
|
serialize_to_json_stream(stream, pretty_print);
|
2012-02-10 01:32:22 +01:00
|
|
|
|
2021-06-20 16:46:08 +02:00
|
|
|
stream.to_str(str);
|
2021-03-15 19:36:49 +01:00
|
|
|
}
|
2012-02-10 01:32:22 +01:00
|
|
|
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2012-02-15 08:46:34 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
bool * Space::get_bool()
|
2017-06-27 18:51:55 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_bool ? &value.value_bool : nullptr;
|
2012-02-10 01:32:22 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
long long * Space::get_llong()
|
2012-02-10 01:32:22 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return get_long_long();
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
long long * Space::get_long_long()
|
2012-06-27 01:20:59 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_long ? &value.value_long : nullptr;
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
float * Space::get_float()
|
2017-06-27 18:51:55 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_float ? &value.value_float : nullptr;
|
2012-06-27 01:20:59 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
double * Space::get_double()
|
2012-06-27 01:20:59 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_double ? &value.value_double : nullptr;
|
2012-06-27 01:20:59 +02:00
|
|
|
}
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
long double * Space::get_long_double()
|
|
|
|
{
|
|
|
|
return type == type_long_double ? &value.value_long_double : nullptr;
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
std::string * Space::get_str()
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_string ? &value.value_string : nullptr;
|
|
|
|
}
|
2017-06-27 18:51:55 +02:00
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
std::wstring * Space::get_wstr()
|
2021-03-15 19:36:49 +01:00
|
|
|
{
|
|
|
|
return type == type_wstring ? &value.value_wstring : nullptr;
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::ObjectType * Space::get_object()
|
|
|
|
{
|
|
|
|
return type == type_object ? &value.value_object : nullptr;
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
Space::TableType * Space::get_table()
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_table ? &value.value_table : nullptr;
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
bool Space::is_equal(const char * val) const
|
|
|
|
{
|
|
|
|
if( type == type_string )
|
|
|
|
{
|
|
|
|
return value.value_string == val;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::is_equal(const std::string & val) const
|
|
|
|
{
|
|
|
|
if( type == type_string )
|
|
|
|
{
|
|
|
|
return value.value_string == val;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::is_equal(const wchar_t * val) const
|
|
|
|
{
|
|
|
|
if( type == type_wstring )
|
|
|
|
{
|
|
|
|
return value.value_wstring == val;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::is_equal(const std::wstring & val) const
|
|
|
|
{
|
|
|
|
if( type == type_wstring )
|
|
|
|
{
|
|
|
|
return value.value_wstring == val;
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-09 17:49:44 +02:00
|
|
|
bool Space::has_value(const char * val) const
|
|
|
|
{
|
|
|
|
if( type == type_string )
|
|
|
|
{
|
|
|
|
return value.value_string == val;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( type == type_table )
|
|
|
|
{
|
|
|
|
for(size_t i=0 ; i < value.value_table.size() ; ++i)
|
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
Space * table_item = value.value_table[i];
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
if( table_item->type == type_string )
|
|
|
|
{
|
2021-04-14 17:42:57 +02:00
|
|
|
if( table_item->value.value_string == val )
|
|
|
|
return true;
|
2021-04-09 17:49:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::has_value(const std::string & val) const
|
|
|
|
{
|
|
|
|
return has_value(val.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::has_value(const wchar_t * val) const
|
|
|
|
{
|
|
|
|
if( type == type_wstring )
|
|
|
|
{
|
|
|
|
return value.value_wstring == val;
|
|
|
|
}
|
|
|
|
|
|
|
|
if( type == type_table )
|
|
|
|
{
|
|
|
|
for(size_t i=0 ; i < value.value_table.size() ; ++i)
|
|
|
|
{
|
2021-05-20 16:11:12 +02:00
|
|
|
Space * table_item = value.value_table[i];
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
if( table_item->type == type_wstring )
|
|
|
|
{
|
2021-04-14 17:42:57 +02:00
|
|
|
if( table_item->value.value_wstring == val )
|
|
|
|
return true;
|
2021-04-09 17:49:44 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::has_value(const std::wstring & val) const
|
|
|
|
{
|
|
|
|
return has_value(val.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * Space::get_space(const wchar_t * field)
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
{
|
|
|
|
if( is_object() )
|
|
|
|
{
|
|
|
|
ObjectType::iterator i = value.value_object.find(field);
|
|
|
|
|
|
|
|
if( i != value.value_object.end() )
|
|
|
|
{
|
|
|
|
return i->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * Space::get_space(const std::wstring & field)
|
|
|
|
{
|
|
|
|
return get_space(field.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-27 15:58:53 +02:00
|
|
|
Space & Space::get_add_space(const wchar_t * field)
|
|
|
|
{
|
|
|
|
pt::Space * space = get_space(field);
|
|
|
|
|
|
|
|
if( !space )
|
|
|
|
{
|
|
|
|
return add_empty_space(field);
|
|
|
|
}
|
|
|
|
|
|
|
|
return *space;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Space & Space::get_add_space(const std::wstring & field)
|
|
|
|
{
|
|
|
|
return get_add_space(field.c_str());
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
bool * Space::get_bool(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_bool() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long * Space::get_llong(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_llong() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
long long * Space::get_long_long(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_long_long() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
float * Space::get_float(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_float() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
double * Space::get_double(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_double() : nullptr;
|
|
|
|
}
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
long double * Space::get_long_double(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
return space ? space->get_long_double() : nullptr;
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
std::string * Space::get_str(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_str() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::wstring * Space::get_wstr(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_wstr() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
Space::ObjectType * Space::get_object(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_object() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
Space::TableType * Space::get_table(const wchar_t * field)
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_table() : nullptr;
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2012-02-12 19:54:06 +01:00
|
|
|
|
2012-01-16 11:16:55 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const bool * Space::get_bool() const
|
2012-07-25 12:27:20 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_bool ? &value.value_bool : nullptr;
|
2012-07-25 12:27:20 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const long long * Space::get_llong() const
|
2012-07-25 12:27:20 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return get_long_long();
|
2012-07-25 12:27:20 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const long long * Space::get_long_long() const
|
2012-07-25 12:27:20 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_long ? &value.value_long : nullptr;
|
2012-07-25 12:27:20 +02:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const float * Space::get_float() const
|
2017-06-27 18:51:55 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_float ? &value.value_float : nullptr;
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
2012-07-25 12:27:20 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const double * Space::get_double() const
|
|
|
|
{
|
|
|
|
return type == type_double ? &value.value_double : nullptr;
|
|
|
|
}
|
2012-07-25 12:27:20 +02:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
const long double * Space::get_long_double() const
|
|
|
|
{
|
|
|
|
return type == type_long_double ? &value.value_long_double : nullptr;
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
const std::string * Space::get_str() const
|
2021-03-15 19:36:49 +01:00
|
|
|
{
|
|
|
|
return type == type_string ? &value.value_string : nullptr;
|
|
|
|
}
|
2012-02-12 19:54:06 +01:00
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
const std::wstring * Space::get_wstr() const
|
2021-03-15 19:36:49 +01:00
|
|
|
{
|
|
|
|
return type == type_wstring ? &value.value_wstring : nullptr;
|
|
|
|
}
|
2012-03-06 14:17:25 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const Space::ObjectType * Space::get_object() const
|
|
|
|
{
|
|
|
|
return type == type_object ? &value.value_object : nullptr;
|
|
|
|
}
|
2012-03-06 14:17:25 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
const Space::TableType * Space::get_table() const
|
2012-03-06 14:17:25 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
return type == type_table ? &value.value_table : nullptr;
|
2012-03-06 14:17:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
bool Space::has_key(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
return get_space(field) != nullptr;
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::has_key(const std::wstring & field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
return get_space(field) != nullptr;
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * Space::get_space(const wchar_t * field) const
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
{
|
|
|
|
if( is_object() )
|
|
|
|
{
|
|
|
|
ObjectType::const_iterator i = value.value_object.find(field);
|
|
|
|
|
|
|
|
if( i != value.value_object.end() )
|
|
|
|
{
|
|
|
|
return i->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * Space::get_space(const std::wstring & field) const
|
2021-05-17 03:08:32 +02:00
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
return get_space(field.c_str());
|
2021-05-17 03:08:32 +02:00
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
const bool * Space::get_bool(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_bool() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const long long * Space::get_llong(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_llong() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const long long * Space::get_long_long(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_long_long() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const float * Space::get_float(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_float() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const double * Space::get_double(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_double() : nullptr;
|
|
|
|
}
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
const long double * Space::get_long_double(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
return space ? space->get_long_double() : nullptr;
|
|
|
|
}
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
const std::string * Space::get_str(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_str() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const std::wstring * Space::get_wstr(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_wstr() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Space::ObjectType * Space::get_object(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_object() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const Space::TableType * Space::get_table(const wchar_t * field) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
return space ? space->get_table() : nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-12 18:49:34 +02:00
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * Space::get_space_nc(const wchar_t * field)
|
2021-04-12 18:49:34 +02:00
|
|
|
{
|
|
|
|
if( is_object() )
|
|
|
|
{
|
|
|
|
ObjectType::iterator i = value.value_object.begin();
|
|
|
|
|
|
|
|
while( i != value.value_object.end() )
|
|
|
|
{
|
2021-05-10 20:04:12 +02:00
|
|
|
if( is_equal_nc(field, i->first.c_str()) )
|
2021-04-12 18:49:34 +02:00
|
|
|
{
|
|
|
|
return i->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
Space * Space::get_space_nc(const std::wstring & field)
|
2021-04-12 18:49:34 +02:00
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
return get_space_nc(field.c_str());
|
2021-04-12 18:49:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * Space::get_space_nc(const wchar_t * field) const
|
2021-04-12 18:49:34 +02:00
|
|
|
{
|
|
|
|
if( is_object() )
|
|
|
|
{
|
|
|
|
ObjectType::const_iterator i = value.value_object.cbegin();
|
|
|
|
|
|
|
|
while( i != value.value_object.cend() )
|
|
|
|
{
|
2021-05-10 20:04:12 +02:00
|
|
|
if( is_equal_nc(field, i->first.c_str()) )
|
2021-04-12 18:49:34 +02:00
|
|
|
{
|
|
|
|
return i->second;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * Space::get_space_nc(const std::wstring & field) const
|
2021-04-12 18:49:34 +02:00
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
return get_space_nc(field.c_str());
|
2021-04-12 18:49:34 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
void Space::remove(const wchar_t * field)
|
|
|
|
{
|
|
|
|
remove(std::wstring(field));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Space::remove(const std::wstring & field)
|
|
|
|
{
|
|
|
|
if( type == type_object )
|
|
|
|
{
|
|
|
|
ObjectType::iterator i = value.value_object.find(field);
|
|
|
|
|
|
|
|
if( i != value.value_object.end() )
|
|
|
|
{
|
|
|
|
delete i->second;
|
|
|
|
i->second = nullptr;
|
|
|
|
|
|
|
|
value.value_object.erase(i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-29 23:25:31 +02:00
|
|
|
void Space::remove(size_t table_index)
|
|
|
|
{
|
|
|
|
if( type == type_table && table_index < value.value_table.size() )
|
|
|
|
{
|
|
|
|
delete value.value_table[table_index];
|
|
|
|
value.value_table[table_index] = nullptr;
|
|
|
|
value.value_table.erase(value.value_table.begin() + table_index);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
bool Space::is_equal(const wchar_t * field, const char * val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->is_equal(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::is_equal(const wchar_t * field, const std::string & val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->is_equal(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::is_equal(const wchar_t * field, const wchar_t * val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->is_equal(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::is_equal(const wchar_t * field, const std::wstring & val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->is_equal(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-04-09 17:49:44 +02:00
|
|
|
bool Space::has_value(const wchar_t * field, const char * val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->has_value(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool Space::has_value(const wchar_t * field, const std::string & val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->has_value(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::has_value(const wchar_t * field, const wchar_t * val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->has_value(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool Space::has_value(const wchar_t * field, const std::wstring & val) const
|
|
|
|
{
|
2021-06-26 22:56:12 +02:00
|
|
|
const Space * space = get_space(field);
|
2021-04-09 17:49:44 +02:00
|
|
|
|
|
|
|
if( space )
|
|
|
|
{
|
|
|
|
return space->has_value(val);
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
|
|
|
|
2021-06-27 15:41:38 +02:00
|
|
|
void Space::copy_from(const Space & space)
|
2017-06-27 18:51:55 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
switch(space.type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
initialize_value_null_if_needed();
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_bool:
|
|
|
|
initialize_value_bool_if_needed();
|
|
|
|
value.value_bool = space.value.value_bool;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_long:
|
|
|
|
initialize_value_long_if_needed();
|
|
|
|
value.value_long = space.value.value_long;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_float:
|
|
|
|
initialize_value_float_if_needed();
|
|
|
|
value.value_float = space.value.value_float;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_double:
|
|
|
|
initialize_value_double_if_needed();
|
|
|
|
value.value_double = space.value.value_double;
|
|
|
|
break;
|
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
case type_long_double:
|
|
|
|
initialize_value_long_double_if_needed();
|
|
|
|
value.value_long_double = space.value.value_long_double;
|
|
|
|
break;
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_string:
|
|
|
|
initialize_value_string_if_needed();
|
|
|
|
value.value_string = space.value.value_string;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_wstring:
|
|
|
|
initialize_value_wstring_if_needed();
|
|
|
|
value.value_wstring = space.value.value_wstring;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_object:
|
|
|
|
copy_value_object(space.value);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_table:
|
|
|
|
copy_value_table(space.value);
|
|
|
|
break;
|
|
|
|
}
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
2012-03-06 14:17:25 +01:00
|
|
|
|
|
|
|
|
2021-03-17 18:09:47 +01:00
|
|
|
|
2012-02-12 19:54:06 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::copy_value_object(const Value & value_from)
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-06-27 15:41:38 +02:00
|
|
|
if( type == type_object )
|
|
|
|
{
|
|
|
|
remove_value_object(true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_object_if_needed();
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
for(auto map_item : value_from.value_object)
|
|
|
|
{
|
|
|
|
Space * new_space = new Space(*map_item.second);
|
|
|
|
value.value_object.insert(std::make_pair(map_item.first, new_space));
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::copy_value_table(const Value & value_from)
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-06-27 15:41:38 +02:00
|
|
|
if( type == type_table )
|
|
|
|
{
|
|
|
|
remove_value_table(true);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
initialize_value_table_if_needed();
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
for(Space * space : value_from.value_table)
|
|
|
|
{
|
|
|
|
Space * new_space = new Space(*space);
|
|
|
|
value.value_table.push_back(new_space);
|
|
|
|
}
|
|
|
|
}
|
2017-06-27 18:51:55 +02:00
|
|
|
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::move_value_from(Space && space)
|
|
|
|
{
|
|
|
|
switch(space.type)
|
|
|
|
{
|
|
|
|
case type_string:
|
|
|
|
initialize_value_string_if_needed(std::move(space.value.value_string));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_wstring:
|
|
|
|
initialize_value_wstring_if_needed(std::move(space.value.value_wstring));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_object:
|
|
|
|
initialize_value_object_if_needed(std::move(space.value.value_object));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case type_table:
|
|
|
|
initialize_value_table_if_needed(std::move(space.value.value_table));
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
2021-06-27 15:41:38 +02:00
|
|
|
copy_from(space);
|
2021-05-19 22:24:53 +02:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void Space::move_from(Space && space)
|
|
|
|
{
|
|
|
|
move_value_from(std::move(space));
|
|
|
|
space.type = Type::type_null;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
void Space::initialize()
|
|
|
|
{
|
|
|
|
type = type_null;
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_null_if_needed()
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_null )
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value();
|
|
|
|
type = type_null;
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_bool_if_needed()
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_bool )
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value();
|
|
|
|
new (&value) bool;
|
|
|
|
type = type_bool;
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_long_if_needed()
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_long )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) long long;
|
|
|
|
type = type_long;
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_float_if_needed()
|
2012-01-16 11:16:55 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_float )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) float;
|
|
|
|
type = type_float;
|
|
|
|
}
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_double_if_needed()
|
|
|
|
{
|
|
|
|
if( type != type_double )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) double;
|
|
|
|
type = type_double;
|
|
|
|
}
|
2012-01-16 11:16:55 +01:00
|
|
|
}
|
|
|
|
|
2012-01-12 01:24:08 +01:00
|
|
|
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
void Space::initialize_value_long_double_if_needed()
|
|
|
|
{
|
|
|
|
if( type != type_long_double )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) long double;
|
|
|
|
type = type_long_double;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_string_if_needed()
|
2012-04-11 22:24:15 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_string )
|
2012-04-11 22:24:15 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value();
|
|
|
|
new (&value) std::string;
|
|
|
|
type = type_string;
|
2012-04-11 22:24:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::initialize_value_string_if_needed(std::string && str)
|
|
|
|
{
|
|
|
|
if( type != type_string )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) std::string(std::move(str));
|
|
|
|
type = type_string;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value.value_string = std::move(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_wstring_if_needed()
|
2012-04-11 22:24:15 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_wstring )
|
2012-04-11 22:24:15 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value();
|
|
|
|
new (&value) std::wstring;
|
|
|
|
type = type_wstring;
|
2012-04-11 22:24:15 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::initialize_value_wstring_if_needed(std::wstring && str)
|
|
|
|
{
|
|
|
|
if( type != type_wstring )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) std::wstring(std::move(str));
|
|
|
|
type = type_wstring;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value.value_wstring = std::move(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_object_if_needed()
|
2012-02-14 21:34:37 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
if( type != type_object )
|
2012-02-14 21:34:37 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value();
|
|
|
|
new (&value) ObjectType;
|
|
|
|
type = type_object;
|
2012-02-14 21:34:37 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::initialize_value_object_if_needed(ObjectType && obj)
|
|
|
|
{
|
|
|
|
if( type != type_object )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) ObjectType(std::move(obj));
|
|
|
|
type = type_object;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-06-27 15:41:38 +02:00
|
|
|
remove_value_object(true);
|
2021-05-19 22:24:53 +02:00
|
|
|
value.value_object = std::move(obj);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-02-14 21:34:37 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::initialize_value_table_if_needed()
|
|
|
|
{
|
|
|
|
if( type != type_table )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) TableType;
|
|
|
|
type = type_table;
|
|
|
|
}
|
|
|
|
}
|
2012-02-14 21:34:37 +01:00
|
|
|
|
|
|
|
|
2021-05-19 22:24:53 +02:00
|
|
|
void Space::initialize_value_table_if_needed(TableType && tab)
|
|
|
|
{
|
|
|
|
if( type != type_table )
|
|
|
|
{
|
|
|
|
remove_value();
|
|
|
|
new (&value) TableType(std::move(tab));
|
|
|
|
type = type_table;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-06-27 15:41:38 +02:00
|
|
|
remove_value_table(true);
|
2021-05-19 22:24:53 +02:00
|
|
|
value.value_table = std::move(tab);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-17 18:09:47 +01:00
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::remove_value()
|
|
|
|
{
|
|
|
|
switch(type)
|
|
|
|
{
|
|
|
|
case type_null:
|
|
|
|
break;
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_bool:
|
|
|
|
case type_long:
|
|
|
|
case type_float:
|
|
|
|
case type_double:
|
added to Space: long double to Space::Value and methods for converting from/to long double
added global methods for converting float/string double/string and long double/string (convert/double.h|cpp):
float to_float(const char * str, const char ** after = nullptr);
float to_float(const wchar_t * str, const wchar_t ** after = nullptr);
double to_double(const char * str, const char ** after = nullptr);
double to_double(const wchar_t * str, const wchar_t ** after = nullptr);
long double to_long_double(const char * str, const char ** after = nullptr);
long double to_long_double(const wchar_t * str, const wchar_t ** after = nullptr);
float to_float(const std::string & str, const char ** after = nullptr);
float to_float(const std::wstring & str, const wchar_t ** after = nullptr);
double to_double(const std::string & str, const char ** after = nullptr);
double to_double(const std::wstring & str, const wchar_t ** after = nullptr);
long double to_long_double(const std::string & str, const char ** after = nullptr);
long double to_long_double(const std::wstring & str, const wchar_t ** after = nullptr);
std::string to_str(float val);
std::wstring to_wstr(float val);
std::string to_str(double val);
std::wstring to_wstr(double val);
std::string to_str(long double val);
std::wstring to_wstr(long double val);
2021-06-23 17:01:43 +02:00
|
|
|
case type_long_double:
|
2021-03-15 19:36:49 +01:00
|
|
|
type = type_null;
|
|
|
|
break;
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_string:
|
|
|
|
{
|
|
|
|
remove_value_string();
|
|
|
|
break;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_wstring:
|
|
|
|
{
|
|
|
|
remove_value_wstring();
|
|
|
|
break;
|
|
|
|
}
|
2017-06-27 18:51:55 +02:00
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_object:
|
2012-01-12 01:24:08 +01:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
remove_value_object();
|
|
|
|
break;
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
case type_table:
|
|
|
|
remove_value_table();
|
|
|
|
break;
|
|
|
|
}
|
2012-01-12 01:24:08 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::remove_value_string()
|
2017-06-27 18:51:55 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
value.value_string.~basic_string();
|
|
|
|
type = type_null;
|
2017-06-27 18:51:55 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-03-15 19:36:49 +01:00
|
|
|
void Space::remove_value_wstring()
|
|
|
|
{
|
|
|
|
value.value_wstring.~basic_string();
|
|
|
|
type = type_null;
|
|
|
|
}
|
2017-06-27 18:51:55 +02:00
|
|
|
|
|
|
|
|
2021-06-27 15:41:38 +02:00
|
|
|
void Space::remove_value_object(bool only_clear)
|
2012-05-10 23:16:19 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
for(auto map_item : value.value_object)
|
|
|
|
{
|
|
|
|
delete map_item.second;
|
|
|
|
map_item.second = nullptr;
|
|
|
|
}
|
|
|
|
|
2021-06-27 15:41:38 +02:00
|
|
|
if( only_clear )
|
|
|
|
{
|
|
|
|
value.value_object.clear();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value.value_object.~ObjectType();
|
|
|
|
type = type_null;
|
|
|
|
}
|
2012-05-10 23:16:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-06-27 15:41:38 +02:00
|
|
|
void Space::remove_value_table(bool only_clear)
|
2012-05-10 23:16:19 +02:00
|
|
|
{
|
2021-03-15 19:36:49 +01:00
|
|
|
for(size_t i = 0 ; i < value.value_table.size() ; ++i)
|
|
|
|
{
|
|
|
|
delete value.value_table[i];
|
|
|
|
value.value_table[i] = nullptr;
|
|
|
|
}
|
2012-05-10 23:16:19 +02:00
|
|
|
|
2021-06-27 15:41:38 +02:00
|
|
|
if( only_clear )
|
|
|
|
{
|
|
|
|
value.value_table.clear();
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
value.value_table.~TableType();
|
|
|
|
type = type_null;
|
|
|
|
}
|
2012-05-10 23:16:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-05-30 00:55:38 +02:00
|
|
|
Space * Space::get_table_item(size_t index)
|
|
|
|
{
|
|
|
|
if( is_table() && index < table_size() )
|
|
|
|
{
|
|
|
|
return value.value_table[index];
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
fixed: in Space: pointers 'name' and 'child_spaces' were not correctly initialized in cctors
added in Space:
- some methods for adding values to an object, such as:
Space & Space::add(const std::wstring & field, bool val) (bool, short, int, long, long long etc.)
- methods for creating lists:
void Space::to_list(std::list<std::string> & output_list, bool clear_list) const
bool Space::to_list(const wchar_t * field, std::list<std::string> & output_list, bool clear_list) const
- methods for converting a value from an object field:
bool Space::to_bool(const wchar_t * field, bool default_value) const
- methods for testing strings:
bool Space::is_equal(const char * val) const
bool Space::is_equal(const std::string & val) const
bool Space::is_equal(const wchar_t * val) const
bool Space::is_equal(const std::wstring & val) const
- methods to get the raw pointer to a value from an object, such as:
bool * Space::get_bool(const wchar_t * field)
float * Space::get_float(const wchar_t * field)
- methods for finding a child space (used in Space format only)
Space * Space::find_child_space(const wchar_t * name)
Space & Space::find_add_child_space(const wchar_t * name)
2021-04-08 17:16:37 +02:00
|
|
|
|
2012-01-12 01:24:08 +01:00
|
|
|
} // namespace
|
|
|
|
|