Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreaiDictionary.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_AI_DICTIONARY__
8 #define __HDI_CORE_AI_DICTIONARY__
9 
10 #include "hdicoreTypes.h"
11 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class IllustratorDictionary;
17  }
18 
19  namespace core
20  {
21  class Art;
22  class UID;
23 
24  namespace ai
25  {
26  class Array;
27  class Entry;
28 
33  class Dictionary
34  {
35  public:
47  class Iterator
48  {
49  public:
57  Iterator(const Iterator& iter_);
58 
64  ~Iterator();
65 
75  Iterator& operator=(const Iterator& rhs_);
76 
85  bool operator==(const Iterator& rhs_) const;
86 
95  bool operator!=(const Iterator& rhs_) const;
96 
104  Iterator& operator++();
105 
113  Iterator operator++(int);
114 
122  Iterator& operator--();
123 
131  Iterator operator--(int);
132 
141  bool atEnd() const;
142 
151  std::string key() const;
152 
160  std::auto_ptr<Entry> value() const;
161 
162 
163  private:
164  // Only Dictionary can construct a new Iterator object
165  friend class Dictionary;
166 
170  void* __data;
171 
177  Iterator();
178 
186  explicit Iterator(const Dictionary& dict_);
187  };
188 
189  typedef std::auto_ptr<Iterator> IteratorAP;
190 
196  Dictionary();
197 
205  Dictionary(const Dictionary& d_);
206 
214  Dictionary(const AIDictionaryRef aiDict_);
215 
221  virtual ~Dictionary();
222 
233  virtual Dictionary& operator=(const Dictionary& rhs_);
234 
243  virtual bool operator==(const Dictionary& rhs_) const;
244 
253  virtual bool operator!=(const Dictionary& rhs_) const;
254 
269  virtual AIDictionaryRef aiDictionaryRef() const;
270 
281  virtual bool getEntry(const std::string& keyName_, Entry& entry__) const;
282 
292  virtual bool setEntry(const std::string& keyName_, const Entry& entry_);
293 
302  virtual bool deleteEntry(const std::string& keyName_);
303 
313  virtual bool getArrayEntry(const std::string& keyName_, Array& array__) const;
314 
324  virtual bool setArrayEntry(const std::string& keyName_, const Array& array_);
325 
335  virtual bool getBoolEntry(const std::string& keyName_, bool& value__) const;
336 
346  virtual bool setBoolEntry(const std::string& keyName_, const bool value_);
347 
357  virtual bool getDictEntry(const std::string& keyName_, Dictionary& dict__) const;
358 
368  virtual bool setDictEntry(const std::string& keyName_, const Dictionary& dict_);
369 
379  virtual bool getIntEntry(const std::string& keyName_, int64_t& value__) const;
380 
390  virtual bool setIntEntry(const std::string& keyName_, const int64_t value_);
391 
401  virtual bool getFloatEntry(const std::string& keyName_, double& value__) const;
402 
418  virtual bool setFloatEntry(const std::string& keyName_, const double value_);
419 
429  virtual bool getStringEntry(const std::string& keyName_, std::string& value__) const;
430 
440  virtual bool setStringEntry(const std::string& keyName_, const std::string& value_);
441 
451  virtual bool getUIDEntry(const std::string& keyName_, UID& uid__) const;
452 
462  virtual bool setUIDEntry(const std::string& keyName_, const UID& value_);
463 
473  virtual bool getArtEntry(const std::string& keyName_, Art& art__) const;
474 
484  virtual bool setArtEntry(const std::string& keyName_, const Art& value_);
485 
494  virtual bool hasKey(const std::string& keyName_) const;
495 
503  virtual bool clear();
504 
520  Iterator begin() const;
521 
522 
523  private:
524  friend plugin::IllustratorDictionary* __accessImpl(const Dictionary&);
525  friend Dictionary __accessCtor(const plugin::IllustratorDictionary&);
526 
530  plugin::IllustratorDictionary* __impl;
531 
537  Dictionary(const plugin::IllustratorDictionary&);
538  };
539 
540  typedef std::auto_ptr<Dictionary> DictionaryAP;
541 
542  extern plugin::IllustratorDictionary* __accessImpl(const Dictionary&);
543  extern Dictionary __accessCtor(const plugin::IllustratorDictionary&);
544  }
545  }
546 }
547 
548 #endif
549 // __HDI_CORE_AI_DICTIONARY__
virtual bool operator!=(const Dictionary &rhs_) const
Tests whether a given Dictionary object is not the same as another.
Handles general art-related functionality.
Definition: hdicoreArt.h:47
Allows for easy UID acquisition, art access, etc.
Definition: hdicoreUID.h:29
Illustrator entry wrapper class to allow for entry creation, manipulation, storage, etc.
Definition: hdicoreaiEntry.h:32
virtual bool operator==(const Dictionary &rhs_) const
Tests whether a given Dictionary object is the same as another.
virtual bool setEntry(const std::string &keyName_, const Entry &entry_)
Sets an entry in the dictionary by key name.
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop...
Allows for iteration through the members of a dictionary, a la std::vector iteration.
Definition: hdicoreaiDictionary.h:47
~Iterator()
Destructs an Iterator object.
virtual bool getEntry(const std::string &keyName_, Entry &entry__) const
Gets an entry from the array by name.
Iterator & operator--()
Prefix decrement operator for reverse iteration.
Embodies Illustrator's dictionary storage containers; can be placed inside an array, or another dictionary.
Definition: hdicoreaiDictionary.h:33
virtual bool deleteEntry(const std::string &keyName_)
Removes an entry in the dictionary by key name.
virtual bool setFloatEntry(const std::string &keyName_, const double value_)
Sets a floating point entry in the dictionary by name.
virtual bool setDictEntry(const std::string &keyName_, const Dictionary &dict_)
Sets a dictionary entry in the dictionary by name.
bool operator!=(const Iterator &rhs_) const
Tests whether a given Iterator object is not the same as another.
virtual bool getArrayEntry(const std::string &keyName_, Array &array__) const
Gets an array entry from 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 getIntEntry(const std::string &keyName_, int64_t &value__) const
Gets an integer entry from the dictionary by name.
std::string key() const
Gets the key for the current entry pointed to by the iterator (or "" if at the end) ...
virtual bool clear()
Removes all entries from the dictionary.
bool operator==(const Iterator &rhs_) const
Tests whether a given Iterator object is the same as another.
virtual ~Dictionary()
Destructs a Dictionary object.
virtual bool setArrayEntry(const std::string &keyName_, const Array &array_)
Sets an array 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.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
virtual bool setUIDEntry(const std::string &keyName_, const UID &value_)
Sets a UID entry in the dictionary by key.
virtual bool setStringEntry(const std::string &keyName_, const std::string &value_)
Sets a string entry in the dictionary by name.
virtual bool setArtEntry(const std::string &keyName_, const Art &value_)
Sets an Art entry in the dictionary by key.
Definition: hdicoreaiArray.h:12
virtual bool getStringEntry(const std::string &keyName_, std::string &value__) const
Gets a string entry from the dictionary by name.
Iterator & operator++()
Prefix increment operator for forward iteration.
virtual bool getBoolEntry(const std::string &keyName_, bool &value__) const
Gets a bool entry from the dictionary by name.
virtual Dictionary & operator=(const Dictionary &rhs_)
Overloaded assignment operator for Dictionary objects.
Dictionary()
Constructs a Dictionary object as a new data container.
virtual bool setBoolEntry(const std::string &keyName_, const bool value_)
Sets a bool entry in the dictionary by name.
virtual AIDictionaryRef aiDictionaryRef() const
Gets the dictionary ref around which the target object is wrapped.
Iterator begin() const
Gets an iterator for the entries in the dictionary, starting with the first.
std::auto_ptr< Entry > value() const
Gets the current entry pointed to by the iterator.
Embodies Illustrator's array storage containers; can be placed inside a dictionary or another array...
Definition: hdicoreaiArray.h:32
virtual bool getUIDEntry(const std::string &keyName_, UID &uid__) const
Gets a UID entry from the dictionary by name.
virtual bool getFloatEntry(const std::string &keyName_, double &value__) const
Gets a floating point entry from the dictionary by name.
Iterator & operator=(const Iterator &rhs_)
Assigns one Iterator object to another.
virtual bool getArtEntry(const std::string &keyName_, Art &art__) const
Gets an Art 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.