acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
atom.h
1// Included enum_dialog_result camilo on 2021-01-21 05:53 PM <3ThomasBorregaardSorensen
2#pragma once
3
4
5#include "acme/constant/element.h"
6#include "acme/prototype/string/_u32hash.h"
7
8#include "acme/prototype/comparison/equals.h"
9#include "acme/prototype/comparison/hash.h"
10#include "acme/prototype/prototype/transfer.h"
11#include "acme/prototype/prototype/type.h"
12#include "acme/prototype/string/string.h"
13#include "acme/prototype/string/string_base.h"
14#include "acme/prototype/string/scoped_string_base.h"
15
16enum enum_id : ::uptr;
17//class type;
18
19//class atom_space;
20
21
22class wparam;
23class lparam;
24
25
26namespace platform { class type; }
27
31//typename < typename ORDERING >
32//constexpr ::std::strong_ordering order squaresuperscript(::std::strong_ordering orderingMajor, ORDERING ordering)
33//{
34//
35// return orderingMajor != 0 ? orderingMajor : orderingMinor;
36//
37//}
38
39
40
41#ifndef NO_TEMPLATE
42
43
44#define __id_is_null_ptr(p) (!(p))
45
46
47inline bool __atom_str_is_empty(const_char_pointer psz)
48{
49
50 return __id_is_null_ptr(psz) || *psz == '\0';
51
52}
53
54
55template <typename T>
56::i32 __atom_sgn(T x)
57{
58
59 return (((T) 0) < x) - (x < ((T) 0));
60
61}
62
63
64//#define __atom_safe_strcmp(a, b) ::str::order(a, b)
65//
66//
67//#define __atom_safe_stricmp(a, b) ::str::case_insensitive_order(a, b)
68//
69//
70//#define __atom_str_begins(a, b) string_begins(a, b)
71//
72//
73//#define case_insensitive___atom_str_begins(a, b) case_insensitive_string_begins(a, b)
74
75
76#else
77
78
79#define __atom_sgn(x) ((0 < (x)) - ((x) < 0))
80
81
82#define __atom_is_null_ptr(p) (!(p))
83
84
85#define __atom_str_is_empty(scopedstr) (__atom_is_null_ptr(scopedstr) || *psz == '\0')
86
87
88
89
90//inline ::i32 __atom_safe_strcmp(const_char_pointer a, const_char_pointer b)
91//{
92//
93// if (__atom_str_is_empty(a))
94// {
95//
96// if (__atom_str_is_empty(b))
97// {
98//
99// return true;
100//
101// }
102// else
103// {
104//
105// return -1;
106//
107// }
108//
109// }
110// else if(__atom_str_is_empty(b))
111// {
112//
113// return 1;
114//
115// }
116// else
117// {
118//
119// return strcmp(a, b);
120//
121// }
122//
123//}
124//
125//
126//inline ::i32 __atom_safe_stricmp(const_char_pointer a, const_char_pointer b)
127//{
128//
129// if (__atom_str_is_empty(a))
130// {
131//
132// if (__atom_str_is_empty(b))
133// {
134//
135// return true;
136//
137// }
138// else
139// {
140//
141// return -1;
142//
143// }
144//
145// }
146// else if (__atom_str_is_empty(b))
147// {
148//
149// return 1;
150//
151// }
152// else
153// {
154//
155// return stricmp(a, b);
156//
157// }
158//
159//}
160//
161//inline bool __atom_str_begins(const_char_pointer a, const_char_pointer b)
162//{
163//
164// if (__atom_str_is_empty(a))
165// {
166//
167// if (__atom_str_is_empty(b))
168// {
169//
170// return true;
171//
172// }
173// else
174// {
175//
176// return false;
177//
178// }
179//
180// }
181// else if (__atom_str_is_empty(b))
182// {
183//
184// return true;
185//
186// }
187// else
188// {
189//
190// return strncmp(a, b, strlen(b));
191//
192// }
193//
194//}
195//
196//
197//inline bool case_insensitive___atom_str_begins(const_char_pointer a, const_char_pointer b)
198//{
199//
200// if (__atom_str_is_empty(a))
201// {
202//
203// if (__atom_str_is_empty(b))
204// {
205//
206// return true;
207//
208// }
209// else
210// {
211//
212// return false;
213//
214// }
215//
216// }
217// else if (__atom_str_is_empty(b))
218// {
219//
220// return true;
221//
222// }
223// else
224// {
225//
226// return strnicmp(a, b, strlen(b));
227//
228// }
229//
230//}
231
232
233#endif
234
235
236class CLASS_DECL_ACME atom
237{
238public:
239
240
241 using PRIMITIVE_ATOM_TAG = PRIMITIVE_ATOM_TAG_TYPE;
242
243 enum enum_type : ::i32
244 {
245
246 e_type_empty = -2,
247
248 e_type_null = -1,
249
250 e_type_integer = 0,
251 e_type_id,
252 e_type_factory,
253 e_type_task_tool,
254 e_type_timer,
255 e_type_message,
256 e_type_subject,
257 e_type_property,
258 e_type_command,
259 //e_type_command_probe,
260 //e_type_has_command_handler,
261 e_type_update,
262 e_type_dialog_result,
263 e_type_impact,
264 e_type_happening,
265 e_type_element,
266 e_type_check,
267 e_type_status,
268 e_type_domainid,
269 e_type_user_message,
270
271 e_type_not_an_atom = 127,
272
273
274 e_type_text = 1ull << 8,
275 e_type_id_text = e_type_id | e_type_text,
276 e_type_factory_text = e_type_factory | e_type_text,
277 e_type_task_tool_text = e_type_task_tool | e_type_text,
278 e_type_timer_text = e_type_timer | e_type_text,
279 e_type_message_text = e_type_message | e_type_text,
280 e_type_property_text = e_type_property | e_type_text,
281 e_type_command_text = e_type_command | e_type_text,
282 //e_type_command_probe_text = e_type_command_probe | e_type_text,
283 //e_type_has_command_handler_text = e_type_has_command_handler | e_type_text,
284 e_type_update_text = e_type_update | e_type_text,
285 e_type_impact_text = e_type_impact | e_type_text,
286 e_type_happening_text = e_type_happening | e_type_text,
287 e_type_element_text = e_type_element | e_type_text,
288
289
290 e_type_range = 1ull << 16,
291 e_type_id_range = e_type_id | e_type_range,
292 e_type_factory_range = e_type_factory | e_type_range,
293 e_type_task_tool_range = e_type_task_tool | e_type_range,
294 e_type_timer_range = e_type_timer | e_type_range,
295 e_type_message_range = e_type_message | e_type_range,
296 e_type_property_range = e_type_property | e_type_range,
297 e_type_command_range = e_type_command | e_type_range,
298 //e_type_command_probe_range = e_type_command_probe | e_type_range,
299 //e_type_has_command_handler_range = e_type_has_command_handler | e_type_range,
300 e_type_update_range = e_type_update | e_type_range,
301 e_type_impact_range = e_type_impact | e_type_range,
302 e_type_happening_range = e_type_happening | e_type_range,
303 e_type_element_range = e_type_element | e_type_range,
304
305
306 };
307
308
309 union
310 {
311
312 enum_id m_eid;
313 enum_impact m_eimpact;
314 enum_property m_eproperty;
315 enum_factory m_efactory;
316 enum_task_tool m_etasktool;
317 enum_timer m_etimer;
318 ::user::enum_message m_eusermessage;
319 ::enum_message m_emessage;
320 enum_dialog_result m_edialogresult;
321 enum_happening m_ehappening;
322 enum_element m_eelement;
323 e_status m_estatus;
324 e_command m_ecommand;
325 e_check m_echeck;
326 domain_id m_domainid;
327 ::string m_str;
328 ::ansi_range m_range;
329 ::i64 m_iLargest;
330 ::u64 m_uLargest;
331
332 };
333
334 enum_type m_etype;
335
336//protected:
337//
338//
339// friend atom_space;
340// inline atom(const ::scoped_string & scopedstr, atom_space *);
341
342
343public:
344
345
346 inline atom();
347 inline atom(enum_type etype);
348 inline atom(enum_id eid);
349 inline atom(enum_element eelement);
350 //inline atom(::enum_id EID);
351 //inline atom(const ::e_command & ecommand);
352 inline atom(::user::enum_message eusermessage);
353 inline atom(::enum_message emessage);
354 //inline atom(ENUM_MESSAGE EMESSAGE);
355 inline atom(enum_impact eimpact);
356 inline atom(ENUM_IMPACT EIMPACT);
357 inline atom(enum_property eproperty);
358 inline atom(enum_factory efactory);
359 inline atom(enum_task_tool etasktool);
360 inline atom(enum_timer etimer);
361 inline atom(enum_dialog_result edialogresult);
362 inline atom(enum_happening ehappening);
363 inline atom(enum_check echeck);
364 inline atom(enum_status estatus);
365
366 inline atom(enum_type etypeAdd, const atom & atom);
367 inline atom(const atom & atom);
368 inline atom(const domain_id & domainid);
369 atom(const_char_pointer psz);
370 atom(const inline_number_string & inlinenumberstring);
371 atom(const ::platform::type & type);
372 //template <typename ITERATOR_TYPE2, ::i32 t_size >
373 //atom(const const_string_range_static_array <ITERATOR_TYPE2, t_size >& a) : atom((const ::string&)a) {}
374
375
376 template < prototype_signed SIGNED >
377 atom(SIGNED i);
378 template < prototype_unsigned UNSIGNED >
379 atom(UNSIGNED u);
380 template < prototype_raw_enum ENUM >
381 atom(ENUM e);
382 template<prototype_enumeration ENUMERATION>
383 atom(const ENUMERATION & e);
384 atom(const ::scoped_string &scopedstr);
385 //atom(const const_ansi_range & range);
386 //atom(const_ansi_range && range);
387 //atom(const const_ansi_range && range);
388 //atom(const ::platform::type & type);
389 template < prototype_character_range RANGE >
390 atom(const RANGE & range);
391 //template < has_as_string_not_payload HAS_AS_STRING_NOT_PAYLOAD >
392 //atom(const HAS_AS_STRING_NOT_PAYLOAD& has_as_string_not_payload);
396 template < prototype_payload PAYLOAD >
397 atom(const PAYLOAD & payload);
398
399 atom(::atom && atom);
400 ~atom()
401 {
402
403 _defer_free();
404
405 m_etype = e_type_null;
406
407 }
408
409 void _defer_free()
410 {
411
412 if (is_text() && !is_range())
413 {
414
415 m_str.::string::~string();
416
417 }
418
419 }
420
421
422 enum_type prototype_type() const
423 {
424
425 if(m_etype < 0)
426 {
427
428 return m_etype;
429
430 }
431 else if(m_etype < e_type_text)
432 {
433
434 return e_type_integer;
435
436 }
437 else
438 {
439
440 return e_type_text;
441
442 }
443
444 }
445
446
447 // returned compounded_type should have same prototype type as the atom
448 enum_type compounded_type(enum_type etypeAdd) const
449 {
450
451 return (enum_type) (
452 (((::iptr) m_etype) & (~(::iptr)0xffff)) |
453 ((::iptr)etypeAdd & (::iptr)0xffff)
454 );
455
456 }
457
458
459 ::atom compounded(enum_type etype) const
460 {
461
462 return {compounded_type(etype), *this};
463
464 }
465
466
467 void set_compounded_type2(enum_type etype)
468 {
469
470 m_etype = compounded_type(etype);
471
472 }
473
474
475 void set_type(enum_type etype)
476 {
477
478 if(m_etype != etype)
479 {
480
481 if(!is_text(etype) || is_range(etype))
482 {
483
484 _defer_free();
485
486 }
487
488 }
489
490 m_etype = etype;
491
492 }
493
494 enum_type get_type() const
495 {
496
497 return m_etype;
498
499 }
500
501
502 bool _is_compounded(enum_type etype) const { return (m_etype & 0xffff) == etype;}
503
504
505
506 bool is_message() const { return m_etype == e_type_message; }
507
508
509 bool is_command() const { return _is_compounded(e_type_command); }
510 //bool is_command_probe() const { return _is_compounded(e_type_command_probe); }
511 //bool is_has_command_handler() const { return _is_compounded(e_type_has_command_handler); }
512 bool is_update() const { return _is_compounded(e_type_update); }
513
514
515 bool is_true(bool bDefault = false) const;
516
517 inline bool operator == (const atom& atom) const;
518 inline ::std::strong_ordering operator <=> (const atom & atom) const;
519
520 template < prototype_character_range RANGE >
521 inline bool operator == (const RANGE & str) const;
522 template < prototype_character_range RANGE >
523 inline ::std::strong_ordering operator <=> (const RANGE & str) const;
524
525 template < character_pointer CHARACTER_POINTER >
526 inline bool operator == (CHARACTER_POINTER p) const;
527 template < character_pointer CHARACTER_POINTER >
528 inline ::std::strong_ordering operator <=> (CHARACTER_POINTER p) const;
529
530 template < character_count n >
531 inline bool operator == (const ::ansi_character (&cha)[n]) const;
532 template < character_count n >
533 inline ::std::strong_ordering operator <=> (const ::ansi_character (&cha)[n]) const;
534
535 //inline ::std::strong_ordering order(const ::scoped_string & scopedstr) const;
536 //inline bool operator == (const ::scoped_string & scopedstr) const;
537 //inline ::std::strong_ordering operator <=> (const ::scoped_string & scopedstr) const;
538 //inline bool operator < (const ::scoped_string & scopedstr) const;
539 //inline bool operator <= (const ::scoped_string & scopedstr) const;
540 //inline bool operator > (const ::scoped_string & scopedstr) const;
541 //inline bool operator >= (const ::scoped_string & scopedstr) const;
542
543
544//#ifndef NO_TEMPLATE
545
546
547 //inline ::std::strong_ordering order(const ::scoped_string & scopedstr) const;
548 //inline bool operator == (const ::scoped_string & scopedstr) const;
549 //inline ::std::strong_ordering operator <=>(const ::scoped_string & scopedstr) const;
550 //inline bool operator < (const ::scoped_string & scopedstr) const;
551 //inline bool operator <= (const ::scoped_string & scopedstr) const;
552 //inline bool operator > (const ::scoped_string & scopedstr) const;
553 //inline bool operator >= (const ::scoped_string & scopedstr) const;
554
555
556
557 //template < prototype_integral INTEGRAL >
558 //inline ::std::strong_ordering order(INTEGRAL i) const;
559
560 template < prototype_integral INTEGRAL >
561 inline bool operator == (INTEGRAL i) const;
562
563 template < prototype_integral INTEGRAL >
564 inline ::std::strong_ordering operator <=> (INTEGRAL i) const;
565 //template < prototype_integral INTEGRAL >
566 //inline bool operator < (INTEGRAL i) const;
567 //template < prototype_integral INTEGRAL >
568 //inline bool operator <= (INTEGRAL i) const;
569 //template < prototype_integral INTEGRAL >
570 //inline bool operator > (INTEGRAL i) const;
571 //template < prototype_integral INTEGRAL >
572 //inline bool operator >= (INTEGRAL i) const;
573
574
575//#endif // !NO_TEMPLATE
576
577
578 //inline ::std::strong_ordering order(::enum_id eid) const;
579 inline bool operator == (::enum_id eid) const;
580 inline ::std::strong_ordering operator <=> (::enum_id eid) const;
581 //inline bool operator < (::enum_id eid) const;
582 //inline bool operator <= (::enum_id eid) const;
583 //inline bool operator > (::enum_id eid) const;
584 //inline bool operator >= (::enum_id eid) const;
585
586
587 // //inline ::std::strong_ordering order(::enum_id EID) const { return order((::enum_id)EID); }
588 // inline bool operator == (::enum_id EID) const { return *this == (::enum_id)EID; }
589 // inline ::std::strong_ordering operator <=> (::enum_id EID) const { return *this <=> (::enum_id)EID; }
590 // //inline bool operator < (::enum_id EID) const { return operator<((::enum_id)EID); }
591 // //inline bool operator <= (::enum_id EID) const { return operator<=((::enum_id)EID); }
592 // //inline bool operator > (::enum_id EID) const { return operator>((::enum_id)EID); }
593 // //inline bool operator >= (::enum_id EID) const { return operator>=((::enum_id)EID); }
594
595 inline bool operator == (::enum_command ecommand) const;
596 inline ::std::strong_ordering operator <=> (::enum_command ecommand) const;
597
598 inline bool operator == (::enum_impact eimpact) const;
599 inline ::std::strong_ordering operator <=> (::enum_impact eid) const;
600
601 inline bool operator == (const ::domain_id & domainid) const;
602 inline ::std::strong_ordering operator <=> (const ::domain_id & domainid) const;
603
604 inline bool operator == (::ENUM_IMPACT EIMPACT) const { return *this == (::enum_impact)EIMPACT; }
605 inline ::std::strong_ordering operator <=> (::ENUM_IMPACT EIMPACT) const { return *this <=> (::enum_impact)EIMPACT; }
606
607 //inline ::std::strong_ordering order(::user::enum_message eusermessage) const;
608 inline bool operator == (::user::enum_message eusermessage) const;
609 inline ::std::strong_ordering operator <=> (::user::enum_message eusermessage) const;
610 inline bool operator==(::enum_message emessage) const;
611 inline ::std::strong_ordering operator<=>(::enum_message emessage) const;
612 // inline bool operator < (::user::enum_message eusermessage) const;
613 //inline bool operator <= (::user::enum_message eusermessage) const;
614 //inline bool operator > (::user::enum_message eusermessage) const;
615 //inline bool operator >= (::user::enum_message eusermessage) const;
616
617
618 // //inline ::std::strong_ordering order(ENUM_MESSAGE EID) const { return order((::user::enum_message)EID); }
619 // inline bool operator == (ENUM_MESSAGE EID) const { return *this == (::user::enum_message)EID; }
620 // inline ::std::strong_ordering operator <=> (ENUM_MESSAGE EID) const { return *this <=> (::user::enum_message)EID; }
621 // //inline bool operator < (ENUM_MESSAGE EID) const { return operator<((::user::enum_message)EID); }
622 // //inline bool operator <= (ENUM_MESSAGE EID) const { return operator<=((::user::enum_message)EID); }
623 // //inline bool operator > (ENUM_MESSAGE EID) const { return operator>((::user::enum_message)EID); }
624 // //inline bool operator >= (ENUM_MESSAGE EID) const { return operator>=((::user::enum_message)EID); }
625
626
627 //inline ::i32 order(::enum_topic etopic) const;
628 //inline bool operator == (::enum_topic etopic) const;
629 //inline bool operator != (::enum_topic etopic) const;
630 //inline bool operator < (::enum_topic etopic) const;
631 //inline bool operator <= (::enum_topic etopic) const;
632 //inline bool operator > (::enum_topic etopic) const;
633 //inline bool operator >= (::enum_topic etopic) const;
634
635
636 //inline ::std::strong_ordering order(::enum_dialog_result edialogresult) const;
637 inline bool operator == (::enum_dialog_result edialogresult) const;
638 inline ::std::strong_ordering operator <=> (::enum_dialog_result edialogresult) const;
639 //inline bool operator < (::enum_dialog_result edialogresult) const;
640 //inline bool operator <= (::enum_dialog_result edialogresult) const;
641 //inline bool operator > (::enum_dialog_result edialogresult) const;
642 //inline bool operator >= (::enum_dialog_result edialogresult) const;
643
644
645 //inline ::std::strong_ordering order(::enum_happening ehappening) const;
646 inline bool operator == (::enum_happening ehappening) const;
647 inline ::std::strong_ordering operator <=> (::enum_happening ehappening) const;
648 //inline bool operator < (::enum_happening ehappening) const;
649 //inline bool operator <= (::enum_happening ehappening) const;
650 //inline bool operator > (::enum_happening ehappening) const;
651 //inline bool operator >= (::enum_happening ehappening) const;
652
653
654 atom & operator = (const atom & atom);
655 //atom & operator = (const ::scoped_string & scopedstr);
656
657//#ifndef NO_TEMPLATE
658//
659// atom & operator = (const ::payload & payload);
660// atom & operator = (const property & prop);
661// atom & operator = (const ::scoped_string & scopedstr);
662//
663//
664 //template < prototype_integer INTEGRAL >
665 //atom & operator = (INTEGER i);
666// template < prototype_natural NATURAL >
667// atom & operator = (NATURAL u);
668//
669//#endif // !NO_TEMPLATE
670//
671//
672// atom & operator = (const enum_id & eid);
673// atom & operator = (const enum_property & eproperty);
674// atom & operator = (const enum_factory & efactory);
675// atom & operator = (const enum_task_tool & etasktool);
676// atom & operator = (const enum_timer & etimer);
677// atom & operator = (const enum_message & emessage);
678// //atom & operator = (const enum_topic & etopic);
679// atom & operator = (const enum_dialog_result & edialogresult);
680
681
682 //inline operator ::iptr() const { return as_iptr(); }
683 //inline operator ::user::enum_message () const { return as_emessage(); }
684
685 inline ::i64 as_i64() const;
686 inline ::iptr as_iptr() const;
687 inline ::i32 as_i32() const { return (::i32) as_i64(); }
688 inline ::u32 as_u32() const { return (::u32) as_i64(); }
689 inline ::collection::index as_index() const { return (::collection::index)as_i64(); }
690 inline ::u32 as_umessage() const { return as_u32(); }
691 inline ::user::enum_message as_eusermessage() const;
692 inline ::enum_message as_emessage1() const;
693 inline ::enum_id as_eid() const;
694 //inline ::e_check as_echeck() const { return m_etype == e_type_check ? m_echeck : (::e_check) e_check_undefined; }
695 //inline ::e_status as_estatus() const { return m_etype == e_type_status ? m_estatus : (::e_status) e_status_none; }
696
697
698#define IMPLEMENT_ATOM_ENUMERATION(ENUMTYPE) \
699 constexpr ::e_ ## ENUMTYPE as_e ## ENUMTYPE() const { return (m_etype == e_type_ ## ENUMTYPE) ? m_e ## ENUMTYPE : (::e_ ## ENUMTYPE) (::enum_ ## ENUMTYPE) 0; } \
700 ::e_ ## ENUMTYPE & e ## ENUMTYPE ## _reference() { set_type(e_type_ ## ENUMTYPE); return m_e ## ENUMTYPE; } \
701 constexpr atom(const ::e_ ## ENUMTYPE & e):m_etype(e_type_ ## ENUMTYPE), m_iLargest((::iptr)e) { }
702// inline explicit payload(::enum_ ## ENUMTYPE e) { m_etype = ::e_type_enum_ ## ENUMTYPE; m_e ## ENUMTYPE = e; } \
703// inline ::e_ ## ENUMTYPE e ## ENUMTYPE(::enum_ ## ENUMTYPE eDefault = enum_default < ::enum_ ## ENUMTYPE >()) const { return e < ::enum_ ## ENUMTYPE >(eDefault); } \
704// inline operator ::e_ ## ENUMTYPE () const { return ::e_ ## ENUMTYPE(); } \
705// ::e_ ## ENUMTYPE & e_ ## ENUMTYPE ## _reference(); \
706// inline payload & operator = (const ::e_ ## ENUMTYPE & e) &{ set_type(::e_type_enum_ ## ENUMTYPE, false); m_e ## ENUMTYPE = e; return *this; } \
707// inline payload & operator = (::enum_ ## ENUMTYPE e) { set_type(::e_type_enum_ ## ENUMTYPE, false); m_e ## ENUMTYPE = e; return *this; } \
708// inline bool equals_enum (::e_ ## ENUMTYPE e) const { return m_etype == ::e_type_enum_ ## ENUMTYPE && m_e ## ENUMTYPE == e; }
709 IMPLEMENT_ATOM_ENUMERATION(status);
710 IMPLEMENT_ATOM_ENUMERATION(command);
711 IMPLEMENT_ATOM_ENUMERATION(check);
712#undef IMPLEMENT_ATOM_ENUMERATION
713
714
715 //inline operator const_char_pointer () const;
716 //inline operator enum_dialog_result () const;
717
718 //inline ::e_check & echeck_reference() { if(m_etype != e_type_check) set_compounded_type(e_type_check); return m_echeck; }
719
720 //::string as_string() const;
721 //::string string() const;
722 ::string as_string() const;
723 ::domain_id as_domainid() const;
724
725
726 //operator ::string() const { return as_string(); }
727
728
729 inline bool is_null() const;
730 inline bool is_empty() const;
731 inline bool has_character() const;
732 inline bool is_set() const { return !is_empty(); }
733
734 inline void Empty();
735 inline void clear();
736
737
738 //inline ::std::strong_ordering CompareNoCase(const ::scoped_string & scopedstr) const { return case_insensitive_order(scopedstr); }
739 inline ::std::strong_ordering case_insensitive_order(const ::scoped_string & scopedstr) const;
740
741
742 inline bool begins(const ::scoped_string & scopedstrPrefix) const;
743 inline bool case_insensitive_begins(const ::scoped_string & scopedstrPrefix) const;
744
745 inline bool ends(const ::scoped_string & scopedstrSuffix) const;
746 inline bool case_insensitive_ends(const ::scoped_string & scopedstrSuffix) const;
747
748
749 constexpr static bool is_text(enum_type etype) { return etype >= e_type_text; }
750 constexpr static bool is_range(enum_type etype) { return etype >= e_type_range; }
751 constexpr static bool is_integer(enum_type etype) { return etype >= 0 && etype < e_type_text; }
752
753
754 constexpr bool is_text() const { return is_text(m_etype); }
755 constexpr bool is_range() const { return is_range(m_etype); }
756 constexpr bool is_integer() const { return is_integer(m_etype); }
757
758
759 //inline atom & operator +=(const ::scoped_string & scopedstr);
760
761
762
763 //inline string operator +(const atom & atom) const;
764 inline ::string operator +(const_char_pointer psz) const;
765 inline ::string operator +(const ::scoped_string & scopedstr) const;
766
767
768 operator ::hash32() const
769 {
770
771 return {
772 (((::u32)m_etype) << 24)
773 ^
774 (
775 is_text() ?
776 ::as_hash32(m_str.c_str()).m_u :
777 ((((::u32)m_uLargest) >> 8) & 0xffffffffu)
778 )
779 };
780
781 }
782
783
784};
785
786
787//template < prototype_character CHARACTER, ::i32 t_size >
788//inline const_string_range_static_array < const CHARACTER*, t_size + 1 > operator + (const const_string_range_static_array < const CHARACTER*, t_size >& a, const ::atom & atom)
789//{
790//
791//
792// return { a, atom.as_string()};
793//
794//
795//}
796
797
798
Definition e_status.h:30
Definition lparam.h:9
Definition payload.h:54
Definition type.h:584
Definition range.h:223
Definition status.h:15
Definition wparam.h:10
Definition _initial_concepts.h:118
include "thread/AutoLock.h"
Definition _forward_declaration.h:877
Definition _forward_declaration.h:1318
Definition compare.h:266