| Qore Programming Language - C/C++ Library 1.12.2

QoreHashNode.h
1 /* -*- mode: c++; indent-tabs-mode: nil -*- */
2 /*
3 QoreHashNode.h
4
5 Qore Programming Language
6
7 Copyright (C) 2003 - 2022 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
39 class LocalVar;
40 class QoreString;
41 class TypedHashDecl;
42
44
50 class QoreHashNode : public AbstractQoreNode {
51 friend class HashIterator;
52 friend class ReverseHashIterator;
53 friend class ConstHashIterator;
54 friend class ReverseConstHashIterator;
55 friend class HashAssignmentHelper;
56 friend class hash_assignment_priv;
57 friend class qore_object_private;
58 friend class qore_hash_private;
59
60 private:
62 DLLLOCAL QoreHashNode(const QoreHashNode&);
63
65 DLLLOCAL QoreHashNode& operator=(const QoreHashNode&);
66
67 protected:
69 class qore_hash_private *priv;
70
72
78 DLLEXPORT virtual bool derefImpl(ExceptionSink* xsink);
79
81
84 DLLLOCAL virtual QoreValue evalImpl(bool &needs_deref, ExceptionSink* xsink) const;
85
87
90 DLLEXPORT virtual ~QoreHashNode();
91
92 public:
94 DLLEXPORT QoreHashNode();
95
97
99 DLLEXPORT QoreHashNode(const TypedHashDecl* hd, ExceptionSink* xsink);
100
102
104 DLLEXPORT QoreHashNode(const QoreTypeInfo* valueTypeInfo);
105
107
109 DLLEXPORT virtual bool getAsBoolImpl() const;
110
112
118 DLLEXPORT virtual int getAsString(QoreString& str, int foff, ExceptionSink* xsink) const;
119
121
128 DLLEXPORT virtual QoreString* getAsString(bool &del, int foff, ExceptionSink* xsink) const;
129
131
133 DLLEXPORT virtual AbstractQoreNode* realCopy() const;
134
136
140 DLLEXPORT virtual bool is_equal_soft(const AbstractQoreNode* v, ExceptionSink* xsink) const;
141
143
147 DLLEXPORT virtual bool is_equal_hard(const AbstractQoreNode* v, ExceptionSink* xsink) const;
148
150
152 DLLEXPORT virtual const char* getTypeName() const;
153
155
157 DLLEXPORT QoreHashNode* hashRefSelf() const;
158
160
162 DLLEXPORT const char* getFirstKey() const;
163
165
167 DLLEXPORT const char* getLastKey() const;
168
170
178 DLLEXPORT QoreValue getKeyValueExistence(const char* key, bool& exists, ExceptionSink* xsink) const;
179
181
188 DLLEXPORT QoreValue getKeyValueExistence(const char* key, bool& exists) const;
189
191
198 DLLEXPORT QoreValue getKeyValue(const char* key, ExceptionSink* xsink) const;
199
201
207 DLLEXPORT QoreValue getKeyValue(const char* key) const;
208
210
218 DLLEXPORT QoreValue getKeyValueExistence(const QoreString& key, bool& exists, ExceptionSink* xsink) const;
219
221
228 DLLEXPORT QoreValue getKeyValueExistence(const QoreString& key, bool& exists) const;
229
231
238 DLLEXPORT QoreValue getKeyValue(const QoreString& key, ExceptionSink* xsink) const;
239
241
247 DLLEXPORT int64 getKeyAsBigInt(const char* key, bool &found) const;
248
250
256 DLLEXPORT bool getKeyAsBool(const char* key, bool &found) const;
257
259
261 DLLEXPORT QoreHashNode* copy() const;
262
263 DLLEXPORT QoreValue& getKeyValueReference(const char* key);
264
266
271 DLLEXPORT void merge(const QoreHashNode* h, ExceptionSink* xsink);
272
274
285 DLLEXPORT int setKeyValue(const char* key, QoreValue value, ExceptionSink* xsink);
286
288
299 DLLEXPORT int setKeyValue(const QoreString& key, QoreValue value, ExceptionSink* xsink);
300
302
307 DLLEXPORT void deleteKey(const QoreString* key, ExceptionSink* xsink);
308
310
314 DLLEXPORT void deleteKey(const char* key, ExceptionSink* xsink);
315
317 DLLEXPORT QoreValue takeKeyValue(const char* key);
318
320
323 DLLEXPORT QoreListNode* getKeys() const;
324
326
331 DLLEXPORT QoreListNode* getValues() const;
332
334
337 DLLEXPORT bool compareSoft(const QoreHashNode* h, ExceptionSink* xsink) const;
338
340
343 DLLEXPORT bool compareHard(const QoreHashNode* h, ExceptionSink* xsink) const;
344
346
348 DLLEXPORT size_t size() const;
349
351
353 DLLEXPORT bool empty() const;
354
356
360 DLLEXPORT bool existsKey(const char* key) const;
361
363
366 DLLEXPORT bool existsKeyValue(const char* key) const;
367
369
373 DLLEXPORT void removeKey(const QoreString* key, ExceptionSink* xsink);
374
376
380 DLLEXPORT void removeKey(const char* key, ExceptionSink* xsink);
381
383
385 DLLEXPORT const TypedHashDecl* getHashDecl() const;
386
388
390 DLLEXPORT const QoreTypeInfo* getValueTypeInfo() const;
391
393
395 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
396
398
400 DLLLOCAL static const char* getStaticTypeName() {
401 return "hash";
402 }
403
405 DLLLOCAL static qore_type_t getStaticTypeCode() {
406 return NT_HASH;
407 }
408
409 static const qore_type_t TYPE = NT_HASH;
410
412 DLLLOCAL virtual int parseInit(QoreValue& val, QoreParseContext& parse_context);
413
414 DLLLOCAL QoreHashNode(bool ne);
415 DLLLOCAL void clear(ExceptionSink* xsink, bool reverse = false);
416
418 DLLLOCAL void clearNeedsEval();
419
421 DLLLOCAL void setNeedsEval();
422
423 // returns a new hash consisting of just the members of value_list
424 DLLLOCAL QoreHashNode* getSlice(const QoreListNode* value_list, ExceptionSink* xsink) const;
425 };
426
427 #include <qore/ReferenceHolder.h>
428
430
433 typedef ReferenceHolder<QoreHashNode> QoreHashNodeHolder;
434
435 class qhi_priv;
436
438
447 class HashIterator {
448 friend class HashAssignmentHelper;
449 friend class qhi_priv;
450
451 protected:
452 QoreHashNode* h;
453 qhi_priv* priv;
454
456 DLLLOCAL HashIterator(const HashIterator&);
457
459 DLLLOCAL HashIterator& operator=(const HashIterator&);
460
462 DLLLOCAL void* operator new(size_t);
463
464 public:
466 DLLEXPORT HashIterator(QoreHashNode* h);
467
469 DLLEXPORT HashIterator(QoreHashNode& h);
470
472 DLLEXPORT ~HashIterator();
473
475
478 DLLEXPORT bool next();
479
481
484 DLLEXPORT bool prev();
485
487 DLLEXPORT const char* getKey() const;
488
490 DLLEXPORT QoreString* getKeyString() const;
491
493 DLLEXPORT QoreValue get() const;
494
496 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
497
499
503 DLLEXPORT void deleteKey(ExceptionSink* xsink);
504
506 DLLEXPORT QoreValue removeKeyValue();
507
509 DLLEXPORT QoreValue getReferenced() const;
510
512 DLLEXPORT QoreHashNode* getHash() const;
513
515 DLLEXPORT bool first() const;
516
518 DLLEXPORT bool last() const;
519
521 DLLEXPORT bool empty() const;
522
524 DLLEXPORT bool valid() const;
525 };
526
528
537 class ReverseHashIterator : public HashIterator {
538 public:
540 DLLEXPORT ReverseHashIterator(QoreHashNode* h);
541
543 DLLEXPORT ReverseHashIterator(QoreHashNode& h);
544
546 DLLEXPORT ~ReverseHashIterator();
547
549
552 DLLEXPORT bool next();
553
555
558 DLLEXPORT bool prev();
559
561 DLLEXPORT bool first() const;
562
564 DLLEXPORT bool last() const;
565 };
566
568
577 class ConstHashIterator {
578 protected:
579 const QoreHashNode* h;
580 qhi_priv* priv;
581
583 DLLLOCAL ConstHashIterator& operator=(const HashIterator&);
584
585 public:
587 DLLEXPORT ConstHashIterator(const QoreHashNode* h);
588
590 DLLEXPORT ConstHashIterator(const QoreHashNode& h);
591
593 DLLLOCAL ConstHashIterator(const ConstHashIterator&);
594
596 DLLEXPORT ~ConstHashIterator();
597
599
602 DLLEXPORT bool next();
603
605
608 DLLEXPORT bool prev();
609
611 DLLEXPORT const char* getKey() const;
612
614 DLLEXPORT QoreString* getKeyString() const;
615
617 DLLEXPORT const QoreValue get() const;
618
620 DLLEXPORT const QoreTypeInfo* getTypeInfo() const;
621
623 DLLEXPORT QoreValue getReferenced() const;
624
626 DLLEXPORT const QoreHashNode* getHash() const;
627
629 DLLEXPORT bool first() const;
630
632 DLLEXPORT bool last() const;
633
635 DLLEXPORT bool empty() const;
636
638 DLLEXPORT bool valid() const;
639
641 DLLEXPORT void reset();
642 };
643
645
654 class ReverseConstHashIterator : public ConstHashIterator {
655 public:
657 DLLEXPORT ReverseConstHashIterator(const QoreHashNode* h);
658
660 DLLEXPORT ReverseConstHashIterator(const QoreHashNode& h);
661
663 DLLEXPORT ~ReverseConstHashIterator();
664
666
669 DLLEXPORT bool next();
670
672
675 DLLEXPORT bool prev();
676
678 DLLEXPORT bool first() const;
679
681 DLLEXPORT bool last() const;
682 };
683
685 class HashAssignmentHelper {
686 friend class hash_assignment_priv;
687 public:
689
693 DLLEXPORT HashAssignmentHelper(QoreHashNode& n_h, const char* key, bool must_already_exist = false);
694
696
700 DLLEXPORT HashAssignmentHelper(QoreHashNode& n_h, const std::string& key, bool must_already_exist = false);
701
703
710 DLLEXPORT HashAssignmentHelper(ExceptionSink* xsink, QoreHashNode& n_h, const QoreString& key, bool must_already_exist = false);
711
713
720 DLLEXPORT HashAssignmentHelper(ExceptionSink* xsink, QoreHashNode& n_h, const QoreString* key, bool must_already_exist = false);
721
723
725 DLLEXPORT HashAssignmentHelper(HashIterator &hi);
726
728 DLLEXPORT ~HashAssignmentHelper();
729
731
736 DLLEXPORT void reassign(const char* key, bool must_already_exist = false);
737
739
744 DLLEXPORT void reassign(const std::string& key, bool must_already_exist = false);
745
747
749 DLLEXPORT operator bool() const;
750
752
756 DLLEXPORT void assign(QoreValue v, ExceptionSink* xsink);
757
759
762 DLLEXPORT QoreValue swap(QoreValue v, ExceptionSink* xsink);
763
765
769 DLLEXPORT QoreValue get() const;
770
772
774 DLLEXPORT QoreValue operator*() const;
775
776 protected:
778 class hash_assignment_priv *priv;
779
780 private:
781 DLLLOCAL HashAssignmentHelper(const HashAssignmentHelper&) = delete;
782 DLLLOCAL HashAssignmentHelper& operator=(const HashAssignmentHelper&) = delete;
783 DLLLOCAL void* operator new(size_t) = delete;
784 };
785
786 #endif // _QORE_HASH_H
AbstractQoreNode
The base class for all value and parse types in Qore expression trees.
Definition: AbstractQoreNode.h:57
AbstractQoreNode::value
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
ConstHashIterator
constant iterator class for QoreHashNode, to be only created on the stack
Definition: QoreHashNode.h:577
ConstHashIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is currently pointing at a valid element
ConstHashIterator::last
DLLEXPORT bool last() const
returns true if on the last key of the hash
ConstHashIterator::getHash
DLLEXPORT const QoreHashNode * getHash() const
returns the hash
ConstHashIterator::~ConstHashIterator
DLLEXPORT ~ConstHashIterator()
Destroys the iterator.
ConstHashIterator::first
DLLEXPORT bool first() const
returns true if on the first key of the hash
ConstHashIterator::getKeyString
DLLEXPORT QoreString * getKeyString() const
returns a QoreString for the current key, the caller owns QoreString returned
ConstHashIterator::reset
DLLEXPORT void reset()
resets the iterator to its initial state
ConstHashIterator::get
DLLEXPORT const QoreValue get() const
returns the value of the current key
ConstHashIterator::prev
DLLEXPORT bool prev()
moves to the previous element, returns false when there are no more elements to iterate
ConstHashIterator::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type info for the current value
ConstHashIterator::getReferenced
DLLEXPORT QoreValue getReferenced() const
returns the value of the current key with an incremented reference count
ConstHashIterator::operator=
DLLLOCAL ConstHashIterator & operator=(const HashIterator &)
this function is not implemented; it is here as a protected function in order to prohibit it from bei...
ConstHashIterator::getKey
DLLEXPORT const char * getKey() const
returns the current key
ConstHashIterator::next
DLLEXPORT bool next()
moves to the next element, returns false when there are no more elements to iterate
ConstHashIterator::empty
DLLEXPORT bool empty() const
returns true if the hash is empty
ConstHashIterator::ConstHashIterator
DLLEXPORT ConstHashIterator(const QoreHashNode *h)
initializes the iterator with the passed hash
ExceptionSink
container for holding Qore-language exception information and also for registering a "thread_exit" ca...
Definition: ExceptionSink.h:48
HashAssignmentHelper
use this class to make assignments to hash keys from a pointer to the key value
Definition: QoreHashNode.h:685
HashAssignmentHelper::~HashAssignmentHelper
DLLEXPORT ~HashAssignmentHelper()
destroys the object and does post processing on the new value
HashAssignmentHelper::swap
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...
HashAssignmentHelper::assign
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...
HashAssignmentHelper::HashAssignmentHelper
DLLEXPORT HashAssignmentHelper(QoreHashNode &n_h, const char *key, bool must_already_exist=false)
constructor taking a const char*
HashAssignmentHelper::operator*
DLLEXPORT QoreValue operator*() const
returns the current value of the hash key; any pointer returned is still owned by the hash
HashAssignmentHelper::priv
class hash_assignment_priv * priv
private implementation
Definition: QoreHashNode.h:778
HashAssignmentHelper::reassign
DLLEXPORT void reassign(const char *key, bool must_already_exist=false)
reassigns the object to the given key for a new assignment
HashAssignmentHelper::get
DLLEXPORT QoreValue get() const
returns the current value of the hash key; the pointer returned is still owned by the hash
HashIterator
iterator class for QoreHashNode, to be only created on the stack
Definition: QoreHashNode.h:447
HashIterator::getReferenced
DLLEXPORT QoreValue getReferenced() const
returns the value of the current key with an incremented reference count
HashIterator::getKey
DLLEXPORT const char * getKey() const
returns the current key
HashIterator::last
DLLEXPORT bool last() const
returns true if on the last key of the hash
HashIterator::valid
DLLEXPORT bool valid() const
returns true if the iterator is currently pointing at a valid element
HashIterator::empty
DLLEXPORT bool empty() const
returns true if the hash is empty
HashIterator::operator=
DLLLOCAL HashIterator & operator=(const HashIterator &)
this function is not implemented; it is here as a private function in order to prohibit it from being...
HashIterator::getKeyString
DLLEXPORT QoreString * getKeyString() const
returns a QoreString for the current key, the caller owns QoreString returned
HashIterator::deleteKey
DLLEXPORT void deleteKey(ExceptionSink *xsink)
deletes the key from the hash and dereferences the value
HashIterator::getHash
DLLEXPORT QoreHashNode * getHash() const
returns the hash
HashIterator::removeKeyValue
DLLEXPORT QoreValue removeKeyValue()
removes the key value and returns the value returned
HashIterator::HashIterator
DLLLOCAL HashIterator(const HashIterator &)
this function is not implemented; it is here as a private function in order to prohibit it from being...
HashIterator::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type info for the current value
HashIterator::next
DLLEXPORT bool next()
moves to the next element, returns false when there are no more elements to iterate
HashIterator::prev
DLLEXPORT bool prev()
moves to the previous element, returns false when there are no more elements to iterate
HashIterator::first
DLLEXPORT bool first() const
returns true if on the first key of the hash
HashIterator::~HashIterator
DLLEXPORT ~HashIterator()
Destroys the iterator.
HashIterator::get
DLLEXPORT QoreValue get() const
returns the value of the current key
QoreHashNode
This is the hash or associative list container type in Qore, dynamically allocated only,...
Definition: QoreHashNode.h:50
QoreHashNode::realCopy
virtual DLLEXPORT AbstractQoreNode * realCopy() const
performs a copy of the hash and returns the new hash
QoreHashNode::existsKeyValue
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)
QoreHashNode::takeKeyValue
DLLEXPORT QoreValue takeKeyValue(const char *key)
removes the value from the hash and returns the value removed, if any
QoreHashNode::setKeyValue
DLLEXPORT int setKeyValue(const char *key, QoreValue value, ExceptionSink *xsink)
sets the value of "key" to "value"
QoreHashNode::getLastKey
DLLEXPORT const char * getLastKey() const
returns the cstring value of the last key in the hash
QoreHashNode::size
DLLEXPORT size_t size() const
returns the number of members in the hash, executes in constant time
QoreHashNode::getKeyValue
DLLEXPORT QoreValue getKeyValue(const char *key, ExceptionSink *xsink) const
returns the value of the given key
QoreHashNode::priv
class qore_hash_private * priv
private implementation of the class
Definition: QoreHashNode.h:69
QoreHashNode::compareSoft
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...
QoreHashNode::QoreHashNode
DLLEXPORT QoreHashNode()
creates an empty hash
QoreHashNode::getValueTypeInfo
DLLEXPORT const QoreTypeInfo * getValueTypeInfo() const
returns the value type declaration (only possible if there is no hashdecl set)
QoreHashNode::existsKey
DLLEXPORT bool existsKey(const char *key) const
returns true if the hash contains the given key
QoreHashNode::is_equal_soft
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...
QoreHashNode::getKeyAsBigInt
DLLEXPORT int64 getKeyAsBigInt(const char *key, bool &found) const
returns the value of the key as an int64
QoreHashNode::parseInit
virtual DLLLOCAL int parseInit(QoreValue &val, QoreParseContext &parse_context)
initializes during parsing
QoreHashNode::setNeedsEval
DLLLOCAL void setNeedsEval()
sets "needs_eval" to true and "value" to false
QoreHashNode::getStaticTypeName
static DLLLOCAL const char * getStaticTypeName()
returns the type name (useful in templates)
Definition: QoreHashNode.h:400
QoreHashNode::getKeyValueExistence
DLLEXPORT QoreValue getKeyValueExistence(const char *key, bool &exists, ExceptionSink *xsink) const
returns the value of the given key
QoreHashNode::derefImpl
virtual DLLEXPORT bool derefImpl(ExceptionSink *xsink)
dereferences all elements of the hash
QoreHashNode::getHashDecl
DLLEXPORT const TypedHashDecl * getHashDecl() const
returns the hash's type declaration, if any
QoreHashNode::removeKey
DLLEXPORT void removeKey(const QoreString *key, ExceptionSink *xsink)
removes the given key from the hash and derefences its value, if any
QoreHashNode::getValues
DLLEXPORT QoreListNode * getValues() const
returns a QoreListNode of AbstractQoreNode pointers representing all values in the hash; caller owns ...
QoreHashNode::getKeyAsBool
DLLEXPORT bool getKeyAsBool(const char *key, bool &found) const
returns the value of the key as a bool
QoreHashNode::getKeys
DLLEXPORT QoreListNode * getKeys() const
returns a QoreListNode of QoreStringNode pointers representing all keys in the hash,...
QoreHashNode::~QoreHashNode
virtual DLLEXPORT ~QoreHashNode()
deletes the object, cannot be called directly (use deref(ExceptionSink*) instead)
QoreHashNode::empty
DLLEXPORT bool empty() const
returns true if the hash has no members, false if not
QoreHashNode::merge
DLLEXPORT void merge(const QoreHashNode *h, ExceptionSink *xsink)
appends all key-value pairs of "h" to this hash
QoreHashNode::copy
DLLEXPORT QoreHashNode * copy() const
performs a copy of the hash and returns the new hash
QoreHashNode::getAsBoolImpl
virtual DLLEXPORT bool getAsBoolImpl() const
returns false unless perl-boolean-evaluation is enabled, in which case it returns false only when emp...
QoreHashNode::getStaticTypeCode
static DLLLOCAL qore_type_t getStaticTypeCode()
returns the type code (useful in templates)
Definition: QoreHashNode.h:405
QoreHashNode::getAsString
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...
QoreHashNode::getTypeInfo
DLLEXPORT const QoreTypeInfo * getTypeInfo() const
returns the type info structure for the current value; also works for hashes derived from a TypedHash...
QoreHashNode::is_equal_hard
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...
QoreHashNode::hashRefSelf
DLLEXPORT QoreHashNode * hashRefSelf() const
returns "this" with an incremented reference count
QoreHashNode::clearNeedsEval
DLLLOCAL void clearNeedsEval()
sets "needs_eval" to false and "value" to true
QoreHashNode::getTypeName
virtual DLLEXPORT const char * getTypeName() const
returns the type name as a c string
QoreHashNode::getFirstKey
DLLEXPORT const char * getFirstKey() const
returns the cstring value of the first key in the hash
QoreHashNode::compareHard
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 ...
QoreHashNode::deleteKey
DLLEXPORT void deleteKey(const QoreString *key, ExceptionSink *xsink)
performs a delete operation on the value of the given key
QoreHashNode::evalImpl
virtual DLLLOCAL QoreValue evalImpl(bool &needs_deref, ExceptionSink *xsink) const
optionally evaluates the argument
QoreListNode
This is the list container type in Qore, dynamically allocated only, reference counted.
Definition: QoreListNode.h:52
QoreString
Qore's string type supported by the QoreEncoding class.
Definition: QoreString.h:93
ReferenceHolder
a templated class to manage a reference count of an object that can throw a Qore-language exception w...
Definition: ReferenceHolder.h:52
ReverseConstHashIterator
reverse constant iterator class for QoreHashNode, to be only created on the stack
Definition: QoreHashNode.h:654
ReverseConstHashIterator::~ReverseConstHashIterator
DLLEXPORT ~ReverseConstHashIterator()
Destroys the iterator.
ReverseConstHashIterator::first
DLLEXPORT bool first() const
returns true if on the last key of the hash
ReverseConstHashIterator::ReverseConstHashIterator
DLLEXPORT ReverseConstHashIterator(const QoreHashNode *h)
initializes the iterator with the passed hash
ReverseConstHashIterator::last
DLLEXPORT bool last() const
returns true if on the first key of the hash
ReverseConstHashIterator::prev
DLLEXPORT bool prev()
moves to the previous element in reverse order, returns false when there are no more elements to iter...
ReverseConstHashIterator::next
DLLEXPORT bool next()
moves to the next element in reverse order, returns false when there are no more elements to iterate
ReverseHashIterator
reverse iterator class for QoreHashNode, to be only created on the stack
Definition: QoreHashNode.h:537
ReverseHashIterator::first
DLLEXPORT bool first() const
returns true if on the last key of the hash
ReverseHashIterator::next
DLLEXPORT bool next()
moves to the next element in reverse order, returns false when there are no more elements to iterate
ReverseHashIterator::ReverseHashIterator
DLLEXPORT ReverseHashIterator(QoreHashNode *h)
initializes the iterator with the passed hash
ReverseHashIterator::~ReverseHashIterator
DLLEXPORT ~ReverseHashIterator()
Destroys the iterator.
ReverseHashIterator::last
DLLEXPORT bool last() const
returns true if on the first key of the hash
ReverseHashIterator::prev
DLLEXPORT bool prev()
moves to the previous element in reverse order, returns false when there are no more elements to iter...
TypedHashDecl
typed hash declaration
Definition: TypedHashDecl.h:44
common.h
qore_type_t
int16_t qore_type_t
used to identify unique Qore data and parse types (descendents of AbstractQoreNode)
Definition: common.h:70
int64
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:260
NT_HASH
const qore_type_t NT_HASH
type value for QoreHashNode
Definition: node_types.h:51
QoreValue
The main value class in Qore, designed to be passed by value.
Definition: QoreValue.h:275