8#include "acme/constant/message.h"
9#include "acme/constant/user_message.h"
12template <
typename ITERATOR_TYPE >
13inline const_string_range < ITERATOR_TYPE >::const_string_range(
const block &
block)
21template <
typename ITERATOR_TYPE >
22inline const_string_range < ITERATOR_TYPE > & const_string_range < ITERATOR_TYPE >::operator = (
const block &
block)
25 if (
block.size() %
sizeof(
decltype(*
block.m_begin)) != 0)
28 throw ::exception(error_failed,
"data type misalignment");
32 this->m_begin = (ITERATOR_TYPE)
block.m_begin;
33 this->m_end = (ITERATOR_TYPE)
block.m_end;
74template <
typename ITERATOR_TYPE >
75template < prototype_block BLOCK >
76inline string_range < ITERATOR_TYPE >::string_range(
const BLOCK &
block) :
155template <
typename ITERATOR_TYPE >
156inline mutable_string_range < ITERATOR_TYPE >::mutable_string_range(
const block &
block) :
157 string_range < ITERATOR_TYPE >(
block)
246 m_etype = e_type_null;
253inline atom::atom(enum_type etype)
263inline atom::atom(enum_id eid) :
265 m_iLargest((::iptr) eid)
271inline atom::atom(enum_element eelement) :
272 m_etype(e_type_element),
273 m_iLargest((::iptr)eelement)
294inline atom::atom(::user::enum_message eusermessage) :
295 m_etype(e_type_user_message),
296 m_iLargest((::iptr)eusermessage)
300inline atom::atom(::enum_message emessage) :
301 m_etype(e_type_message), m_iLargest((::iptr)emessage)
313inline atom::atom(enum_impact eimpact) :
314 m_etype(e_type_impact),
315 m_iLargest((::iptr)eimpact)
321inline atom::atom(ENUM_IMPACT EIMPACT) :
322 atom((::enum_impact) EIMPACT)
328inline atom::atom(enum_property eproperty) :
329 m_etype(e_type_property),
330 m_iLargest((::iptr)eproperty)
336inline atom::atom(enum_factory efactory) :
337 m_etype(e_type_factory),
338 m_iLargest((::i64)efactory)
344inline atom::atom(enum_task_tool etasktool) :
345 m_etype(e_type_task_tool),
346 m_iLargest((::iptr)etasktool)
352inline atom::atom(enum_timer etimer) :
353 m_etype(e_type_timer),
354 m_iLargest((::iptr)etimer)
368inline atom::atom(enum_dialog_result edialogresult) :
369 m_etype(e_type_dialog_result),
370 m_iLargest((::iptr)edialogresult)
376inline atom::atom(enum_happening ehappening) :
377 m_etype(e_type_happening),
378 m_iLargest((::iptr)ehappening)
384inline atom::atom(enum_check echeck) :
385 m_etype(e_type_check),
386 m_iLargest((::iptr)echeck)
392inline atom::atom(enum_status estatus) :
393 m_etype(e_type_status),
394 m_iLargest((::iptr)estatus)
402inline atom::atom(enum_type etypeAdd, const ::atom &
atom)
408 m_etype = (enum_type) (etypeAdd | e_type_text);
410 m_str.construct_from_string(atom.m_str);
413 else if (atom.is_integer())
418 m_iLargest = atom.m_iLargest;
435 m_etype = atom.m_etype;
436 if (atom.m_etype >= 0)
438 if (atom.m_etype & e_type_text)
440 m_str.construct_from_string(::transfer(atom.m_str));
444 m_uLargest = atom.m_uLargest;
447 atom.m_etype = e_type_integer;
458 m_etype = atom.m_etype;
460 m_str.construct_from_string(atom.m_str);
466 m_uLargest = atom.m_uLargest;
467 m_etype = atom.m_etype;
474inline atom::atom(
const domain_id & domainid) :
475 m_etype(e_type_domainid),
479 m_domainid = domainid;
483inline atom::atom(const_char_pointer psz) :
487 m_etype = e_type_text;
492inline atom::atom(const ::scoped_string & scopedstr) :
496 m_etype = e_type_text;
501inline atom::atom(const ::inline_number_string & inline_number_string) :
502 m_str(inline_number_string)
505 m_etype = e_type_text;
510inline atom::atom(const ::platform::type & type) :
514 m_etype = e_type_text;
519template < prototype_
signed SIGNED >
520inline atom::atom(SIGNED i)
523 m_etype = e_type_integer;
525 m_iLargest = (::iptr) i;
530template < prototype_
unsigned UNSIGNED >
531inline atom::atom(UNSIGNED u)
534 m_etype = e_type_integer;
541template < prototype_raw_enum ENUM >
542inline atom::atom(ENUM e)
545 m_etype = e_type_integer;
547 m_iLargest = ::as_i64(e);
552template<prototype_enumeration ENUMERATION>
553inline atom::atom(
const ENUMERATION & e) :
562inline bool atom::operator == (
const atom &
atom)
const
565 if (m_etype != atom.m_etype)
575 return m_str == atom.m_str;
581 return m_iLargest == atom.m_iLargest;
588inline ::std::strong_ordering atom::operator <=>(
const atom &
atom)
const
591 auto compare = m_etype <=> atom.m_etype;
603 return m_str <=> atom.m_str;
609 return m_iLargest <=> atom.m_iLargest;
659 if (is_text() && !is_range())
662 if(atom.is_text() && !atom.is_range())
676 m_range = atom.m_range;
682 m_uLargest = atom.m_uLargest;
695 m_range = atom.m_range;
698 else if (atom.is_text())
701 m_str.construct_from_string(atom.m_str);
707 m_uLargest = atom.m_uLargest;
713 m_etype = atom.m_etype;
720template < prototype_
character_range RANGE >
721inline bool atom::operator == (
const RANGE &
range)
const
724 return is_text() ? m_str == range :
false;
806inline bool atom::is_empty()
const
809 return is_null() || m_etype == e_type_empty || (is_text() && m_str.is_empty());
821template <
character_po
inter CHARACTER_POINTER >
822inline bool atom::operator == (CHARACTER_POINTER p)
const
825 return is_text() ? m_str == p :
false;
830template < prototype_
character_range RANGE >
831inline ::std::strong_ordering atom::operator<=>(
const RANGE &
range)
const
834 return is_text() ? m_str <=> range : m_etype <=> e_type_text;
882template < prototype_
integral INTEGRAL >
883inline bool atom::operator == (INTEGRAL i)
const
886return ::comparison::tuple
888[&]() {
return m_etype == e_type_integer; },
889[&]() {
return m_iLargest == i; }
895template < prototype_
integral INTEGRAL >
896inline ::std::strong_ordering atom::operator <=>(INTEGRAL i)
const
899return ::comparison::tuple
901[&]() {
return m_etype <=> e_type_integer; },
902[&]() {
return m_iLargest <=> i; }
956inline bool atom::operator == (::enum_id eid)
const
959 return ::comparison::tuple
961 [&]() {
return m_etype == e_type_id; },
962 [&]() {
return m_eid == eid; }
968inline ::std::strong_ordering atom::operator <=>(::enum_id eid)
const
971 return ::comparison::tuple
973 [&]() {
return m_etype <=> e_type_id; },
974 [&]() {
return m_eid <=> eid; }
980inline bool atom::operator == (::enum_command ecommand)
const
983 return ::comparison::tuple
985 [&]() {
return m_etype == e_type_command; },
986 [&]() {
return m_ecommand == ecommand; }
992inline ::std::strong_ordering atom::operator <=>(::enum_command ecommand)
const
995 return ::comparison::tuple
997 [&]() {
return m_etype <=> e_type_command; },
998 [&]() {
return m_ecommand <=> ecommand; }
1004inline bool atom::operator == (::enum_impact eimpact)
const
1007 return ::comparison::tuple
1009 [&]() {
return m_etype == e_type_impact; },
1010 [&]() {
return m_eimpact == eimpact; }
1016inline ::std::strong_ordering atom::operator <=>(::enum_impact eimpact)
const
1019 return ::comparison::tuple
1021 [&]() {
return m_etype <=> e_type_impact; },
1022 [&]() {
return m_eimpact <=> eimpact; }
1029inline bool atom::operator == (const ::domain_id & domainid)
const
1032 return ::comparison::tuple
1034 [&]() {
return m_etype == e_type_domainid; },
1035 [&]() {
return m_domainid == domainid; }
1041inline ::std::strong_ordering atom::operator <=>(const ::domain_id & domainid)
const
1044 return ::comparison::tuple
1046 [&]() {
return m_etype <=> e_type_domainid; },
1047 [&]() {
return m_domainid <=> domainid; }
1093inline bool atom::operator == (::user::enum_message eusermessage)
const
1096 return ::comparison::tuple
1098 [&]() {
return m_etype == e_type_message; },
1099 [&]() {
return m_eusermessage == eusermessage; }
1106inline ::std::strong_ordering atom::operator <=>(::user::enum_message eusermessage)
const
1109 return ::comparison::tuple
1111 [&]() {
return m_etype <=> e_type_message; },
1112 [&]() {
return m_eusermessage <=> eusermessage; }
1120inline bool atom::operator==(::enum_message emessage)
const
1123 return ::comparison::tuple([&]() {
return m_etype == e_type_message; },
1124 [&]() {
return m_emessage == emessage; });
1128inline ::std::strong_ordering atom::operator<=>(::enum_message emessage)
const
1131 return ::comparison::tuple([&]() {
return m_etype <=> e_type_message; },
1132 [&]() {
return m_emessage <=> emessage; });
1232inline bool atom::operator == (::enum_dialog_result edialogresult)
const
1235 return ::comparison::tuple
1237 [&]() {
return m_etype == e_type_dialog_result; },
1238 [&]() {
return m_edialogresult == edialogresult; }
1244inline ::std::strong_ordering atom::operator <=>(::enum_dialog_result edialogresult)
const
1247 return ::comparison::tuple
1249 [&]() {
return m_etype <=> e_type_dialog_result; },
1250 [&]() {
return m_edialogresult <=> edialogresult; }
1297inline bool atom::operator == (::enum_happening ehappening)
const
1300 return ::comparison::tuple
1302 [&]() {
return m_etype == e_type_happening; },
1303 [&]() {
return m_ehappening == ehappening; }
1309inline ::std::strong_ordering atom::operator <=>(::enum_happening ehappening)
const
1312 return ::comparison::tuple
1314 [&]() {
return m_etype <=> e_type_happening; },
1315 [&]() {
return m_ehappening <=> ehappening; }
1369inline ::i64 atom::as_i64()
const
1372 return prototype_type() == e_type_integer ? m_iLargest : 0x8000000000000000ll;
1377inline ::iptr atom::as_iptr()
const
1380 return prototype_type() == e_type_integer ? m_iLargest : INTPTR_MIN;
1385inline ::user::enum_message atom::as_eusermessage()
const
1388 return m_etype == e_type_user_message ? m_eusermessage : (::user::enum_message) ::user::e_message_undefined;
1393inline ::enum_message atom::as_emessage1()
const
1396 return m_etype == e_type_message ? m_emessage : (::enum_message)::e_message_undefined;
1400inline enum_id atom::as_eid()
const
1403 return m_etype == e_type_id ? m_eid : (enum_id)0;
1424inline bool atom::is_null()
const
1427 return m_etype == e_type_null || (is_text() && m_str.is_empty());
1432inline bool atom::has_character()
const
1435 return is_text() && m_str.has_character();
1440inline void atom::Empty()
1443 m_etype = e_type_empty;
1450inline void atom::clear()
1453 m_etype = e_type_null;
1461inline ::std::strong_ordering atom::case_insensitive_order(const ::scoped_string & scopedstr)
const
1467 if (scopedstr.is_empty())
1470 return ::std::strong_ordering::equal;
1476 return ::std::strong_ordering::less;
1481 else if(scopedstr.is_empty())
1484 return ::std::strong_ordering::greater;
1490 return m_str.case_insensitive_order(scopedstr);
1498inline bool EqualElements< atom >(
atom element1,
atom element2)
1501 return element1 == element2;
1529inline bool atom::begins(const ::scoped_string & scopedstrCandidatePrefix)
const
1532 if (scopedstrCandidatePrefix.is_empty())
1539 if (is_empty() || is_integer())
1548 return m_str.begins(scopedstrCandidatePrefix);
1554 throw "Unexpected::atom m_etype";
1563inline bool atom::case_insensitive_begins(const ::scoped_string & scopedstrCandidatePrefix)
const
1566 if (scopedstrCandidatePrefix.is_empty())
1582 return m_str.case_insensitive_begins(scopedstrCandidatePrefix);
1597inline bool atom::ends(const ::scoped_string & scopedstrCandidateSuffix)
const
1600 if (scopedstrCandidateSuffix.is_empty())
1607 if (is_empty() || is_integer())
1616 return m_str.ends(scopedstrCandidateSuffix);
1622 throw "Unexpected::atom m_etype";
1631inline bool atom::case_insensitive_ends(const ::scoped_string & scopedstrCandidateSuffix)
const
1634 if (scopedstrCandidateSuffix.is_empty())
1650 return m_str.case_insensitive_ends(scopedstrCandidateSuffix);
1656 throw "Unexpected ::atom m_etype";
1669inline void from_string(
::atom &
atom, const_char_pointer psz)
1812template <
typename CHAR >
1813string_base < CHAR > & string_base < CHAR >::append(const ::atom &
atom)
1819 return append(
atom.m_range);
1825 return append(
atom.as_string());
1917template < prototype_payload PAYLOAD >
1918atom::atom(
const PAYLOAD &
payload)
1921 m_etype = e_type_integer;
1925 if (payload.is_null())
1928 operator = (e_type_null);
1931 else if (payload.is_empty())
1934 operator = (e_type_empty);
1937 else if (payload.get_type() == ::e_type_atom)
1940 operator = (payload.as_atom());
1949 else if (payload.is_integer())
1952 operator = (payload.as_iptr());
1958 operator = (payload.as_string());
1976inline ::string atom::operator +(const_char_pointer psz)
const
1979 return this->as_string() + psz;
1984inline ::string atom::operator +(const ::scoped_string & scopedstr)
const
1987 return this->as_string() + scopedstr;
1992template <
character_count n >
1993inline bool atom::operator == (const ::ansi_character (&cha)[n])
const
1996 return *
this == ::scoped_string(cha);
2001template <
character_count n >
2002inline ::std::strong_ordering atom::operator <=> (const ::ansi_character (&cha)[n])
const
2005 return *this <=> ::scoped_string(cha);
class of operations on a range of characters that are not changed. m_begin, m_end or m_erange should ...
Definition const_string_range.h:82