Browse Source

added: Space::Space(const Date & date), Space::set(const Date & date), Space::add(const Date & date), Space::add(const wchar_t * field, const Date & date)

htmlparserlistener
Tomasz Sowa 1 year ago
parent
commit
bb9205a55e
  1. 31
      src/space/space.cpp
  2. 5
      src/space/space.h

31
src/space/space.cpp

@ -188,6 +188,12 @@ Space::Space(const Space * space)
set(space);
}
Space::Space(const Date & date)
{
initialize();
set(date);
}
void Space::clear()
{
@ -427,6 +433,13 @@ void Space::set(Space && space)
move_from(std::move(space));
}
void Space::set(const Date & date)
{
initialize_value_wstring_if_needed();
WTextStream str;
date.SerializeISO(str);
str.to_str(value.value_wstring);
}
Space & Space::add(bool val)
@ -528,6 +541,12 @@ Space & Space::add(Space && space)
}
Space & Space::add(const Date & date)
{
return add_generic(date);
}
Space & Space::add_empty_space()
{
return add_generic(static_cast<Space*>(nullptr));
@ -643,6 +662,13 @@ Space & Space::add(const wchar_t * field, Space && space)
return *(insert_res.first->second);
}
Space & Space::add(const wchar_t * field, const Date & date)
{
return add_generic(field, date);
}
Space & Space::add_empty_space(const wchar_t * field)
{
return add_generic(field, static_cast<Space*>(nullptr));
@ -746,6 +772,11 @@ Space & Space::add(const std::wstring & field, Space && space)
return add(field.c_str(), std::move(space));
}
Space & Space::add(const std::wstring & field, const Date & date)
{
return add_generic(field, date);
}
Space & Space::add_empty_space(const std::wstring & field)
{
return add_generic(field, static_cast<Space*>(nullptr));

5
src/space/space.h

@ -207,6 +207,7 @@ public:
Space(const std::string & str);
Space(const std::wstring & str);
Space(const Space * space);
Space(const Date & date);
void clear();
@ -243,6 +244,7 @@ public:
void set(const Space & space);
void set(const Space * space);
void set(Space && space);
void set(const Date & date);
// add a value to the table, change to table if needed, return the reference to the new inserted item
@ -265,6 +267,7 @@ public:
Space & add(const Space & space);
Space & add(const Space * space);
Space & add(Space && space);
Space & add(const Date & date);
Space & add_empty_space(); // IMPROVEME rename me to something better
@ -289,6 +292,7 @@ public:
Space & add(const wchar_t * field, const Space & space);
Space & add(const wchar_t * field, const Space * space);
Space & add(const wchar_t * field, Space && space);
Space & add(const wchar_t * field, const Date & date);
Space & add_empty_space(const wchar_t * field); // IMPROVEME rename me to something better
Space & add(const std::wstring & field, bool val);
@ -310,6 +314,7 @@ public:
Space & add(const std::wstring & field, const Space & space);
Space & add(const std::wstring & field, const Space * space);
Space & add(const std::wstring & field, Space && space);
Space & add(const std::wstring & field, const Date & date);
Space & add_empty_space(const std::wstring & field); // IMPROVEME rename me to something better

Loading…
Cancel
Save