Qore Programming Language 2.1.1
Loading...
Searching...
No Matches
QoreHashNode.h
1/* -*- mode: c++; indent-tabs-mode: nil -*- */
2/*
3 QoreHashNode.h
4
5 Qore Programming Language
6
7 Copyright (C) 2003 - 2024 Qore Technologies, s.r.o.
8
9 Permission is hereby granted, free of charge, to any person obtaining a
10 copy of this software and associated documentation files (the "Software"),
11 to deal in the Software without restriction, including without limitation
12 the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 and/or sell copies of the Software, and to permit persons to whom the
14 Software is furnished to do so, subject to the following conditions:
15
16 The above copyright notice and this permission notice shall be included in
17 all copies or substantial portions of the Software.
18
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26
27 Note that the Qore library is released under a choice of three open-source
28 licenses: MIT (as above), LGPL 2+, or GPL 2+; see README-LICENSE for more
29 information.
30*/
31
32#ifndef _QORE_QOREHASHNODE_H
33
34#define _QORE_QOREHASHNODE_H
35
36#include <qore/AbstractQoreNode.h>
37#include <qore/common.h>
38
39class LocalVar;
40class QoreString;
41class QoreStringNode;
42class TypedHashDecl;
43
45
52 friend class HashIterator;
53 friend class ReverseHashIterator;
54 friend class ConstHashIterator;
55 friend class ReverseConstHashIterator;
56 friend class HashAssignmentHelper;
57 friend class hash_assignment_priv;
58 friend class qore_object_private;
59 friend class qore_hash_private;
60
61public:
63 DLLEXPORT QoreHashNode();
64
66
68 DLLEXPORT QoreHashNode(const TypedHashDecl* hd, ExceptionSink* xsink);
69
71
73 DLLEXPORT QoreHashNode(const QoreTypeInfo* valueTypeInfo);
74
76
78 DLLEXPORT virtual bool getAsBoolImpl() const;
79
81
87 DLLEXPORT virtual int getAsString(QoreString& str, int foff, ExceptionSink* xsink) const;
88
90
97 DLLEXPORT virtual QoreString* getAsString(bool &del, int foff, ExceptionSink* xsink) const;
98
100
102 DLLEXPORT virtual QoreHashNode* realCopy() const;
103
105
109 DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode* v, ExceptionSink* xsink) const;
110
112
116 DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode* v, ExceptionSink* xsink) const;
117
119
121 DLLEXPORT virtual const char* getTypeName() const;
122
124
126 DLLEXPORT QoreHashNode* hashRefSelf() const;
127
129
131 DLLEXPORT const char* getFirstKey() const;
132
134
136 DLLEXPORT const char* getLastKey() const;
137
139
147 DLLEXPORT QoreValue getKeyValueExistence(const char* key, bool& exists, ExceptionSink* xsink) const;
148
150
157 DLLEXPORT QoreValue getKeyValueExistence(const char* key, bool& exists) const;
158
160
167 DLLEXPORT QoreValue getKeyValue(const char* key, ExceptionSink* xsink) const;
168
170
176 DLLEXPORT QoreValue getKeyValue(const char* key) const;
177
179
187 DLLEXPORT QoreValue getKeyValueExistence(const QoreString& key, bool& exists, ExceptionSink* xsink) const;
188
190
197 DLLEXPORT QoreValue getKeyValueExistence(const QoreString& key, bool& exists) const;
198
200
207 DLLEXPORT QoreValue getKeyValue(const QoreString& key, ExceptionSink* xsink) const;
208
210
216 DLLEXPORT int64 getKeyAsBigInt(const char* key, bool &found) const;
217
219
225 DLLEXPORT bool getKeyAsBool(const char* key, bool &found) const;
226
228
230 DLLEXPORT QoreHashNode* copy() const;
231
232 DLLEXPORT QoreValue& getKeyValueReference(const char* key);
233
235
240 DLLEXPORT void merge(const QoreHashNode* h, ExceptionSink* xsink);
241
243
254 DLLEXPORT int setKeyValue(const char* key, QoreValue value, ExceptionSink* xsink);
255
257
268 DLLEXPORT int setKeyValue(const QoreString& key, QoreValue value, ExceptionSink* xsink);
269
271
276 DLLEXPORT void deleteKey(const QoreString* key, ExceptionSink* xsink);
277
279
283 DLLEXPORT void deleteKey(const char* key, ExceptionSink* xsink);
284
286 DLLEXPORT QoreValue takeKeyValue(const char* key);
287
289
292 DLLEXPORT QoreListNode* getKeys() const;
293
295
300 DLLEXPORT QoreListNode* getValues() const;
301
303
306 DLLEXPORT bool compareSoft(const QoreHashNode* h, ExceptionSink* xsink) const;
307
309
312 DLLEXPORT bool compareHard(const QoreHashNode* h, ExceptionSink* xsink) const;
313
315
317 DLLEXPORT size_t size() const;
318
320
322 DLLEXPORT bool empty() const;
323
325
329 DLLEXPORT bool existsKey(const char* key) const;
330
332
335 DLLEXPORT bool existsKeyValue(const char* key) const;
336
338
342 DLLEXPORT void removeKey(const QoreString* key, ExceptionSink* xsink);
343
345
349 DLLEXPORT void removeKey(const char* key, ExceptionSink* xsink);
350
352
354 DLLEXPORT const TypedHashDecl* getHashDecl() const;
355
357
359 DLLEXPORT const QoreTypeInfo* getValueTypeInfo() const;
360
362
364 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
365
367
369 DLLLOCAL static const char* getStaticTypeName() {
370 return "hash";
371 }
372
374 DLLLOCAL static qore_type_t getStaticTypeCode() {
375 return NT_HASH;
376 }
377
378 static const qore_type_t TYPE = NT_HASH;
379
381
383 DLLEXPORT void weakRef();
384
386
390 DLLEXPORT bool weakDeref();
391
393 DLLLOCAL virtual int parseInit(QoreValue& val, QoreParseContext& parse_context);
394
395 DLLLOCAL QoreHashNode(bool ne);
396 DLLLOCAL void clear(ExceptionSink* xsink, bool reverse = false);
397
399 DLLLOCAL void clearNeedsEval();
400
402 DLLLOCAL void setNeedsEval();
403
404 // returns a new hash consisting of just the members of value_list
405 DLLLOCAL QoreHashNode* getSlice(const QoreListNode* value_list, ExceptionSink* xsink) const;
406
407protected:
409 class qore_hash_private *priv;
410
412
418 DLLEXPORT virtual bool derefImpl(ExceptionSink* xsink);
419
421
424 DLLLOCAL virtual QoreValue evalImpl(bool &needs_deref, ExceptionSink* xsink) const;
425
427
430 DLLEXPORT virtual ~QoreHashNode();
431
432private:
433 DLLLOCAL QoreHashNode(const QoreHashNode&) = delete;
434 DLLLOCAL QoreHashNode& operator=(const QoreHashNode&) = delete;
435};
436
437#include <qore/ReferenceHolder.h>
438
440
444
445class qhi_priv;
446
448
458 friend class HashAssignmentHelper;
459 friend class qhi_priv;
460
461protected:
462 QoreHashNode* h;
463 qhi_priv* priv;
464
466 DLLLOCAL HashIterator(const HashIterator&);
467
470
472 DLLLOCAL void* operator new(size_t);
473
474public:
477
480
482 DLLEXPORT ~HashIterator();
483
485
488 DLLEXPORT bool next();
489
491
494 DLLEXPORT bool prev();
495
497 DLLEXPORT const char* getKey() const;
498
500 DLLEXPORT QoreString* getKeyString() const;
501
504
506 DLLEXPORT QoreValue get() const;
507
509 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
510
512
516 DLLEXPORT void deleteKey(ExceptionSink* xsink);
517
519
532 DLLEXPORT int assign(QoreValue val, ExceptionSink* xsink);
533
536
538 DLLEXPORT QoreValue getReferenced() const;
539
541 DLLEXPORT QoreHashNode* getHash() const;
542
544 DLLEXPORT bool first() const;
545
547 DLLEXPORT bool last() const;
548
550 DLLEXPORT bool empty() const;
551
553 DLLEXPORT bool valid() const;
554};
555
557
567public:
570
573
576
578
581 DLLEXPORT bool next();
582
584
587 DLLEXPORT bool prev();
588
590 DLLEXPORT bool first() const;
591
593 DLLEXPORT bool last() const;
594};
595
597
607protected:
608 const QoreHashNode* h;
609 qhi_priv* priv;
610
613
614public:
616 DLLEXPORT ConstHashIterator(const QoreHashNode* h);
617
619 DLLEXPORT ConstHashIterator(const QoreHashNode& h);
620
623
626
628
631 DLLEXPORT bool next();
632
634
637 DLLEXPORT bool prev();
638
640 DLLEXPORT const char* getKey() const;
641
643 DLLEXPORT QoreString* getKeyString() const;
644
647
649 DLLEXPORT const QoreValue get() const;
650
652 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
653
655 DLLEXPORT QoreValue getReferenced() const;
656
658 DLLEXPORT const QoreHashNode* getHash() const;
659
661 DLLEXPORT bool first() const;
662
664 DLLEXPORT bool last() const;
665
667 DLLEXPORT bool empty() const;
668
670 DLLEXPORT bool valid() const;
671
673 DLLEXPORT void reset();
674};
675
677
687public:
690
693
696
698
701 DLLEXPORT bool next();
702
704
707 DLLEXPORT bool prev();
708
710 DLLEXPORT bool first() const;
711
713 DLLEXPORT bool last() const;
714};
715
718friend class hash_assignment_priv;
719public:
721
725 DLLEXPORT HashAssignmentHelper(QoreHashNode& n_h, const char* key, bool must_already_exist = false);
726
728
732 DLLEXPORT HashAssignmentHelper(QoreHashNode& n_h, const std::string& key, bool must_already_exist = false);
733
735
742 DLLEXPORT HashAssignmentHelper(ExceptionSink* xsink, QoreHashNode& n_h, const QoreString& key, bool must_already_exist = false);
743
745
752 DLLEXPORT HashAssignmentHelper(ExceptionSink* xsink, QoreHashNode& n_h, const QoreString* key, bool must_already_exist = false);
753
755
758
761
763
768 DLLEXPORT void reassign(const char* key, bool must_already_exist = false);
769
771
776 DLLEXPORT void reassign(const std::string& key, bool must_already_exist = false);
777
779
781 DLLEXPORT operator bool() const;
782
784
788 DLLEXPORT void assign(QoreValue v, ExceptionSink* xsink);
789
791
794 DLLEXPORT QoreValue swap(QoreValue v, ExceptionSink* xsink);
795
797
801 DLLEXPORT QoreValue get() const;
802
804
806 DLLEXPORT QoreValue operator*() const;
807
809
813 DLLEXPORT const char* getKey() const;
814
815protected:
817 class hash_assignment_priv *priv;
818
819private:
820 DLLLOCAL HashAssignmentHelper(const HashAssignmentHelper&) = delete;
821 DLLLOCAL HashAssignmentHelper& operator=(const HashAssignmentHelper&) = delete;
822 DLLLOCAL void* operator new(size_t) = delete;
823};
824
825#endif // _QORE_HASH_H
The base class for all value and parse types in Qore expression trees.
Definition AbstractQoreNode.h:57
bool value
this is true for values, if false then either the type needs evaluation to produce a value or is a pa...
Definition AbstractQoreNode.h:330
constant iterator class for QoreHashNode, to be only created on the stack
Definition QoreHashNode.h:606
DLLEXPORT bool valid() const
returns true if the iterator is currently pointing at a valid element
DLLEXPORT QoreStringNode * getKeyStringNode() const
returns a QoreStringNode for the current key, the caller owns QoreString returned
DLLEXPORT bool last() const
returns true if on the last key of the hash
DLLEXPORT const QoreHashNode * getHash() const
returns the hash
DLLEXPORT ~ConstHashIterator()
Destroys the iterator.
DLLEXPORT const char * getKey() const
returns the current key
DLLEXPORT bool first() const
returns true if on the first key of the hash
DLLEXPORT void reset()
resets the iterator to its initial state
DLLEXPORT const QoreValue get() const
returns the value of the current key
DLLEXPORT bool prev()
moves to the previous element, returns false when there are no more elements to iterate
DLLEXPORT QoreValue getReferenced() const
returns the value of the current key with an incremented reference count
DLLLOCAL ConstHashIterator(const ConstHashIterator &)
copy constructor
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type info for the current value
DLLEXPORT bool next()
moves to the next element, returns false when there are no more elements to iterate
DLLLOCAL ConstHashIterator & operator=(const HashIterator &)
this function is not implemented; it is here as a protected function in order to prohibit it from bei...
DLLEXPORT bool empty() const
returns true if the hash is empty
DLLEXPORT QoreString * getKeyString() const
returns a QoreString for the current key, the caller owns QoreString returned
DLLEXPORT ConstHashIterator(const QoreHashNode *h)
initializes the iterator with the passed hash
DLLEXPORT ConstHashIterator(const QoreHashNode &h)
initializes the iterator with the passed hash
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition ExceptionSink.h:50
use this class to make assignments to hash keys from a pointer to the key value
Definition QoreHashNode.h:717
DLLEXPORT HashAssignmentHelper(ExceptionSink *xsink, QoreHashNode &n_h, const QoreString &key, bool must_already_exist=false)
constructor taking a const QoreString&
DLLEXPORT ~HashAssignmentHelper()
destroys the object and does post processing on the new value
DLLEXPORT const char * getKey() const
Returns the current key.
DLLEXPORT QoreValue swap(QoreValue v, ExceptionSink *xsink)
swaps the current value with the new value of the hash key, assumes that the new value is already ref...
DLLEXPORT void assign(QoreValue v, ExceptionSink *xsink)
assigns a value to the hash key, dereferences any old value, assumes that the value is already refere...
DLLEXPORT HashAssignmentHelper(QoreHashNode &n_h, const char *key, bool must_already_exist=false)
constructor taking a const char*
DLLEXPORT QoreValue operator*() const
returns the current value of the hash key; any pointer returned is still owned by the hash
DLLEXPORT HashAssignmentHelper(HashIterator &hi)
constructor taking a HashIterator&
class hash_assignment_priv * priv
private implementation
Definition QoreHashNode.h:817
DLLEXPORT void reassign(const std::string &key, bool must_already_exist=false)
reassigns the object to the given key for a new assignment
DLLEXPORT void reassign(const char *key, bool must_already_exist=false)
reassigns the object to the given key for a new assignment
DLLEXPORT HashAssignmentHelper(ExceptionSink *xsink, QoreHashNode &n_h, const QoreString *key, bool must_already_exist=false)
constructor taking a const QoreString&
DLLEXPORT QoreValue get() const
returns the current value of the hash key; the pointer returned is still owned by the hash
DLLEXPORT HashAssignmentHelper(QoreHashNode &n_h, const std::string &key, bool must_already_exist=false)
constructor taking a const std::string&
iterator class for QoreHashNode, to be only created on the stack
Definition QoreHashNode.h:457
DLLEXPORT int assign(QoreValue val, ExceptionSink *xsink)
Assigns the given value to the key and dereferences any current value.
DLLEXPORT QoreValue getReferenced() const
returns the value of the current key with an incremented reference count
DLLEXPORT bool last() const
returns true if on the last key of the hash
DLLEXPORT bool valid() const
returns true if the iterator is currently pointing at a valid element
DLLEXPORT bool empty() const
returns true if the hash is empty
DLLEXPORT QoreString * getKeyString() const
returns a QoreString for the current key, the caller owns QoreString returned
DLLEXPORT QoreHashNode * getHash() const
returns the hash
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type info for the current value
DLLEXPORT HashIterator(QoreHashNode *h)
initializes the iterator with the passed hash
DLLEXPORT void deleteKey(ExceptionSink *xsink)
deletes the key from the hash and dereferences the value
DLLEXPORT QoreStringNode * getKeyStringNode() const
returns a QoreStringNode for the current key, the caller owns QoreString returned
DLLEXPORT HashIterator(QoreHashNode &h)
initializes the iterator with the passed hash
DLLEXPORT QoreValue removeKeyValue()
removes the key value and returns the value returned
DLLLOCAL HashIterator(const HashIterator &)
this function is not implemented; it is here as a private function in order to prohibit it from being...
DLLEXPORT const char * getKey() const
returns the current key
DLLEXPORT bool next()
moves to the next element, returns false when there are no more elements to iterate
DLLLOCAL HashIterator & operator=(const HashIterator &)
this function is not implemented; it is here as a private function in order to prohibit it from being...
DLLEXPORT bool prev()
moves to the previous element, returns false when there are no more elements to iterate
DLLEXPORT bool first() const
returns true if on the first key of the hash
DLLEXPORT ~HashIterator()
Destroys the iterator.
DLLEXPORT QoreValue get() const
returns the value of the current key
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition QoreHashNode.h:51
static DLLLOCAL const char * getStaticTypeName()
returns the type name (useful in templates)
Definition QoreHashNode.h:369
DLLEXPORT bool existsKeyValue(const char *key) const
returns true if the hash contains the given key and the key has a value (i.e. is not NOTHING)
DLLEXPORT QoreValue takeKeyValue(const char *key)
removes the value from the hash and returns the value removed, if any
DLLEXPORT const TypedHashDecl * getHashDecl() const
returns the hash's type declaration, if any
DLLEXPORT int setKeyValue(const char *key, QoreValue value, ExceptionSink *xsink)
sets the value of "key" to "value"
DLLEXPORT QoreHashNode * hashRefSelf() const
returns "this" with an incremented reference count
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type info structure for the current value; also works for hashes derived from a TypedHash...
DLLEXPORT size_t size() const
returns the number of members in the hash, executes in constant time
DLLEXPORT QoreValue getKeyValue(const char *key, ExceptionSink *xsink) const
returns the value of the given key
class qore_hash_private * priv
private implementation of the class
Definition QoreHashNode.h:409
DLLEXPORT QoreListNode * getKeys() const
returns a QoreListNode of QoreStringNode pointers representing all keys in the hash,...
DLLEXPORT bool compareSoft(const QoreHashNode *h, ExceptionSink *xsink) const
does a deep "soft" compare of all hash elements (types may be converted for the comparison) and retur...
DLLEXPORT QoreHashNode()
creates an empty hash
DLLEXPORT const char * getFirstKey() const
returns the cstring value of the first key in the hash
DLLEXPORT QoreValue getKeyValue(const char *key) const
returns the value of the given key
DLLEXPORT void removeKey(const char *key, ExceptionSink *xsink)
removes the given key from the hash and derefences its value, if any
virtual DLLEXPORT QoreString * getAsString(bool &del, int foff, ExceptionSink *xsink) const
returns a QoreString giving the verbose string representation of the List (including all contained va...
DLLEXPORT bool existsKey(const char *key) const
returns true if the hash contains the given key
virtual DLLEXPORT bool is_equal_soft(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality ("deep compare" including all contained values) with possible type conversion (sof...
DLLEXPORT int64 getKeyAsBigInt(const char *key, bool &found) const
returns the value of the key as an int64
virtual DLLLOCAL int parseInit(QoreValue &val, QoreParseContext &parse_context)
initializes during parsing
DLLLOCAL void setNeedsEval()
sets "needs_eval" to true and "value" to false
DLLEXPORT const char * getLastKey() const
returns the cstring value of the last key in the hash
DLLEXPORT QoreValue getKeyValueExistence(const QoreString &key, bool &exists) const
returns the value of the given key
DLLEXPORT QoreValue getKeyValueExistence(const char *key, bool &exists, ExceptionSink *xsink) const
returns the value of the given key
virtual DLLEXPORT QoreHashNode * realCopy() const
performs a copy of the hash and returns the new hash
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
dereferences all elements of the hash
DLLEXPORT void removeKey(const QoreString *key, ExceptionSink *xsink)
removes the given key from the hash and derefences its value, if any
DLLEXPORT int setKeyValue(const QoreString &key, QoreValue value, ExceptionSink *xsink)
sets the value of "key" to "value"
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
DLLEXPORT bool getKeyAsBool(const char *key, bool &found) const
returns the value of the key as a bool
virtual DLLEXPORT ~QoreHashNode()
deletes the object, cannot be called directly (use deref(ExceptionSink*) instead)
DLLEXPORT bool weakDeref()
Decrements the weak reference count for this object.
DLLEXPORT void deleteKey(const char *key, ExceptionSink *xsink)
performs a delete operation on the value of the given key
DLLEXPORT bool empty() const
returns true if the hash has no members, false if not
DLLEXPORT QoreValue getKeyValueExistence(const char *key, bool &exists) const
returns the value of the given key
DLLEXPORT QoreHashNode(const QoreTypeInfo *valueTypeInfo)
creates an empty hash with the specific value type
DLLEXPORT void merge(const QoreHashNode *h, ExceptionSink *xsink)
appends all key-value pairs of "h" to this hash
virtual DLLEXPORT bool getAsBoolImpl() const
returns false unless perl-boolean-evaluation is enabled, in which case it returns false only when emp...
DLLEXPORT QoreValue getKeyValue(const QoreString &key, ExceptionSink *xsink) const
returns the value of the given key
static DLLLOCAL qore_type_t getStaticTypeCode()
returns the type code (useful in templates)
Definition QoreHashNode.h:374
DLLEXPORT QoreValue getKeyValueExistence(const QoreString &key, bool &exists, ExceptionSink *xsink) const
returns the value of the given key
virtual DLLEXPORT int getAsString(QoreString &str, int foff, ExceptionSink *xsink) const
concatenate the verbose string representation of the list (including all contained values) to an exis...
DLLEXPORT QoreHashNode * copy() const
performs a copy of the hash and returns the new hash
virtual DLLEXPORT bool is_equal_hard(const AbstractQoreNode *v, ExceptionSink *xsink) const
tests for equality ("deep compare" including all contained values) without type conversions (hard com...
DLLEXPORT QoreListNode * getValues() const
returns a QoreListNode of AbstractQoreNode pointers representing all values in the hash; caller owns ...
DLLEXPORT const QoreTypeInfo * getValueTypeInfo() const
returns the value type declaration (only possible if there is no hashdecl set)
DLLLOCAL void clearNeedsEval()
sets "needs_eval" to false and "value" to true
DLLEXPORT void weakRef()
Increments the weak reference count for this object.
DLLEXPORT bool compareHard(const QoreHashNode *h, ExceptionSink *xsink) const
does a deep "hard" compare of all hash elements (no type conversions are performed) and returns true ...
DLLEXPORT void deleteKey(const QoreString *key, ExceptionSink *xsink)
performs a delete operation on the value of the given key
DLLEXPORT QoreHashNode(const TypedHashDecl *hd, ExceptionSink *xsink)
creates a hash of the specific type; the hash is initialized according to the hashdecl declaration
virtual DLLLOCAL QoreValue evalImpl(bool &needs_deref, ExceptionSink *xsink) const
optionally evaluates the argument
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition QoreListNode.h:52
Qore's string type supported by the QoreEncoding class.
Definition QoreString.h:93
Qore's string value type, reference counted, dynamically-allocated only.
Definition QoreStringNode.h:50
a templated class to manage a reference count of an object that can throw a Qore-language exception w...
Definition ReferenceHolder.h:52
reverse constant iterator class for QoreHashNode, to be only created on the stack
Definition QoreHashNode.h:686
DLLEXPORT ~ReverseConstHashIterator()
Destroys the iterator.
DLLEXPORT bool first() const
returns true if on the last key of the hash
DLLEXPORT ReverseConstHashIterator(const QoreHashNode *h)
initializes the iterator with the passed hash
DLLEXPORT bool last() const
returns true if on the first key of the hash
DLLEXPORT bool prev()
moves to the previous element in reverse order, returns false when there are no more elements to iter...
DLLEXPORT ReverseConstHashIterator(const QoreHashNode &h)
initializes the iterator with the passed hash
DLLEXPORT bool next()
moves to the next element in reverse order, returns false when there are no more elements to iterate
reverse iterator class for QoreHashNode, to be only created on the stack
Definition QoreHashNode.h:566
DLLEXPORT bool first() const
returns true if on the last key of the hash
DLLEXPORT bool next()
moves to the next element in reverse order, returns false when there are no more elements to iterate
DLLEXPORT ReverseHashIterator(QoreHashNode &h)
initializes the iterator with the passed hash
DLLEXPORT ReverseHashIterator(QoreHashNode *h)
initializes the iterator with the passed hash
DLLEXPORT ~ReverseHashIterator()
Destroys the iterator.
DLLEXPORT bool last() const
returns true if on the first key of the hash
DLLEXPORT bool prev()
moves to the previous element in reverse order, returns false when there are no more elements to iter...
typed hash declaration
Definition TypedHashDecl.h:44
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode)
Definition common.h:76
long long int64
64bit integer type, cannot use int64_t here since it breaks the API on some 64-bit systems due to equ...
Definition common.h:266
const qore_type_t NT_HASH
type value for QoreHashNode
Definition node_types.h:51
The main value class in Qore, designed to be passed by value.
Definition QoreValue.h:279