Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreaiDictionary.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_AI_DICTIONARY__
8#define __HDI_CORE_AI_DICTIONARY__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include "hdicoreTypes.h"
13
14namespace hdi
15{
16 namespace aip
17 {
18 class IllustratorDictionary;
19 }
20
21 namespace core
22 {
23 class Art;
24 class UID;
25
26 namespace ai
27 {
28 class Array;
29 class Entry;
30
36 {
37 public:
50 {
51 public:
59 Iterator(const Iterator& iter_);
60
67
78
87 bool operator==(const Iterator& rhs_) const;
88
97 bool operator!=(const Iterator& rhs_) const;
98
107
116
125
134
143 bool atEnd() const;
144
153 std::string key() const;
154
162 std::unique_ptr<Entry> value() const;
163
164
165 private:
166 // Only Dictionary can construct a new Iterator object
167 friend class Dictionary;
168
172 void* __data;
173
179 Iterator();
180
188 explicit Iterator(const Dictionary& dict_);
189 };
190
191 typedef std::unique_ptr<Iterator> IteratorUP;
192 typedef std::shared_ptr<Iterator> IteratorSP;
193 typedef std::weak_ptr<Iterator> IteratorWP;
194
201
210
218 Dictionary(const AIDictionaryRef aiDict_);
219
225 virtual ~Dictionary();
226
237 virtual Dictionary& operator=(const Dictionary& rhs_);
238
247 virtual bool operator==(const Dictionary& rhs_) const;
248
257 virtual bool operator!=(const Dictionary& rhs_) const;
258
273 virtual AIDictionaryRef aiDictionaryRef() const;
274
285 virtual bool getEntry(const std::string& keyName_, Entry& entry__) const;
286
296 virtual bool setEntry(const std::string& keyName_, const Entry& entry_);
297
306 virtual bool deleteEntry(const std::string& keyName_);
307
317 virtual bool getArrayEntry(const std::string& keyName_, Array& array__) const;
318
328 virtual bool setArrayEntry(const std::string& keyName_, const Array& array_);
329
339 virtual bool getBoolEntry(const std::string& keyName_, bool& value__) const;
340
350 virtual bool setBoolEntry(const std::string& keyName_, const bool value_);
351
361 virtual bool getDictEntry(const std::string& keyName_, Dictionary& dict__) const;
362
372 virtual bool setDictEntry(const std::string& keyName_, const Dictionary& dict_);
373
383 virtual bool getIntEntry(const std::string& keyName_, int64_t& value__) const;
384
394 virtual bool setIntEntry(const std::string& keyName_, const int64_t value_);
395
405 virtual bool getFloatEntry(const std::string& keyName_, double& value__) const;
406
420 virtual bool setFloatEntry(const std::string& keyName_, const double value_);
421
431 virtual bool getStringEntry(const std::string& keyName_, std::string& value__) const;
432
442 virtual bool setStringEntry(const std::string& keyName_, const std::string& value_);
443
453 virtual bool getUIDEntry(const std::string& keyName_, UID& uid__) const;
454
464 virtual bool setUIDEntry(const std::string& keyName_, const UID& value_);
465
475 virtual bool getArtEntry(const std::string& keyName_, Art& art__) const;
476
486 virtual bool setArtEntry(const std::string& keyName_, const Art& value_);
487
496 virtual bool hasKey(const std::string& keyName_) const;
497
505 virtual bool clear();
506
523
524
525 private:
526 friend aip::IllustratorDictionary* __accessImpl(const Dictionary&);
527 friend Dictionary __accessCtor(const aip::IllustratorDictionary&);
528
532 aip::IllustratorDictionary* __impl;
533
539 Dictionary(const aip::IllustratorDictionary&);
540 };
541
542 typedef std::unique_ptr<Dictionary> DictionaryUP;
543 typedef std::shared_ptr<Dictionary> DictionarySP;
544 typedef std::weak_ptr<Dictionary> DictionaryWP;
545
546 extern aip::IllustratorDictionary* __accessImpl(const Dictionary&);
547 extern Dictionary __accessCtor(const aip::IllustratorDictionary&);
548 }
549 }
550}
551
552#endif
553// HDI_CORE_AIP_MODE
554
555#endif
556// __HDI_CORE_AI_DICTIONARY__
Handles general art-related functionality.
Definition: hdicoreArt.h:51
Allows for easy UID acquisition, art access, etc.
Definition: hdicoreUID.h:32
Embodies Illustrator's array storage containers; can be placed inside a dictionary or another array.
Definition: hdicoreaiArray.h:35
Allows for iteration through the members of a dictionary, a la std::vector iteration.
Definition: hdicoreaiDictionary.h:50
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop.
Iterator operator--(int)
Postfix decrement operator for reverse iteration.
Iterator & operator--()
Prefix decrement operator for reverse iteration.
std::unique_ptr< Entry > value() const
Gets the current entry pointed to by the iterator.
bool operator==(const Iterator &rhs_) const
Tests whether a given Iterator object is the same as another.
Iterator operator++(int)
Postfix increment operator for forward iteration.
bool operator!=(const Iterator &rhs_) const
Tests whether a given Iterator object is not the same as another.
Iterator(const Iterator &iter_)
Constructs an Iterator object from an existing Iterator object (copy constructor)
~Iterator()
Destructs an Iterator object.
Iterator & operator=(const Iterator &rhs_)
Assigns one Iterator object to another.
Iterator & operator++()
Prefix increment operator for forward iteration.
std::string key() const
Gets the key for the current entry pointed to by the iterator (or "" if at the end)
Embodies Illustrator's dictionary storage containers; can be placed inside an array,...
Definition: hdicoreaiDictionary.h:36
virtual bool getEntry(const std::string &keyName_, Entry &entry__) const
Gets an entry from the array by name.
virtual Dictionary & operator=(const Dictionary &rhs_)
Overloaded assignment operator for Dictionary objects.
virtual bool operator==(const Dictionary &rhs_) const
Tests whether a given Dictionary object is the same as another.
virtual AIDictionaryRef aiDictionaryRef() const
Gets the dictionary ref around which the target object is wrapped.
virtual bool getArtEntry(const std::string &keyName_, Art &art__) const
Gets an Art entry from the dictionary by name.
Dictionary()
Constructs a Dictionary object as a new data container.
virtual bool getBoolEntry(const std::string &keyName_, bool &value__) const
Gets a bool entry from the dictionary by name.
Dictionary(const Dictionary &d_)
Dictionary copy constructor.
virtual bool getUIDEntry(const std::string &keyName_, UID &uid__) const
Gets a UID entry from the dictionary by name.
virtual bool setFloatEntry(const std::string &keyName_, const double value_)
Sets a floating point entry in the dictionary by name.
virtual bool setIntEntry(const std::string &keyName_, const int64_t value_)
Sets an integer entry in the dictionary by name.
virtual bool getFloatEntry(const std::string &keyName_, double &value__) const
Gets a floating point entry from the dictionary by name.
virtual bool setArrayEntry(const std::string &keyName_, const Array &array_)
Sets an array entry in the dictionary by name.
virtual bool getIntEntry(const std::string &keyName_, int64_t &value__) const
Gets an integer entry from the dictionary by name.
virtual bool clear()
Removes all entries from the dictionary.
virtual bool setDictEntry(const std::string &keyName_, const Dictionary &dict_)
Sets a dictionary entry in the dictionary by name.
virtual bool operator!=(const Dictionary &rhs_) const
Tests whether a given Dictionary object is not the same as another.
virtual bool setEntry(const std::string &keyName_, const Entry &entry_)
Sets an entry in the dictionary by key name.
Dictionary(const AIDictionaryRef aiDict_)
Constructs a new Dictionary object from an AIDictionaryRef.
virtual bool deleteEntry(const std::string &keyName_)
Removes an entry in the dictionary by key name.
virtual bool setArtEntry(const std::string &keyName_, const Art &value_)
Sets an Art entry in the dictionary by key.
Iterator begin() const
Gets an iterator for the entries in the dictionary, starting with the first.
virtual bool setBoolEntry(const std::string &keyName_, const bool value_)
Sets a bool entry in the dictionary by name.
virtual bool getDictEntry(const std::string &keyName_, Dictionary &dict__) const
Gets a dictionary entry from the dictionary by name.
virtual bool hasKey(const std::string &keyName_) const
Tests whether the dictionary has an entry with a particular key.
virtual ~Dictionary()
Destructs a Dictionary object.
virtual bool setStringEntry(const std::string &keyName_, const std::string &value_)
Sets a string entry in the dictionary by name.
virtual bool getArrayEntry(const std::string &keyName_, Array &array__) const
Gets an array entry from the dictionary by name.
virtual bool setUIDEntry(const std::string &keyName_, const UID &value_)
Sets a UID entry in the dictionary by key.
virtual bool getStringEntry(const std::string &keyName_, std::string &value__) const
Gets a string entry from the dictionary by name.
Illustrator entry wrapper class to allow for entry creation, manipulation, storage,...
Definition: hdicoreaiEntry.h:35
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.