9 #include <Raym/Object.h>
10 #include <Raym/String.h>
11 #include <Raym/Array.h>
12 #include <Raym/Number.h>
13 //#include <Raym/URL.h>
18 class Dictionary : public Object
24 class KeyAndValue : public Object
32 static KeyAndValue *keyAndValue(String *key, Object *value);
36 virtual const char *className();
39 std::vector<Object *> _dict;
42 // static Dictionary *dictionaryWithData(Data *data, StringEncoding encoding);
43 // static Array *arrayWithData(Data *data, StringEncoding encoding);
45 void writeTo(int fd, int level);
46 void writeValue(int fd, int level, Object *value);
48 std::string toString(int level);
49 std::string toStringValue(int level, Object *value);
53 static Dictionary *dictionaryWithCapacity(UInteger numItems);
54 static Dictionary *dictionaryWithDictionary(Dictionary *dictionary);
55 // static Dictionary *dictionaryWithContentsOfURL(URL *url);
56 static Dictionary *alloc();
57 Dictionary *initWithCapacity(UInteger numItems);
58 Dictionary *initWithDictionary(Dictionary *dictionary);
59 Dictionary *initWithContentsOfFile(String *path);
60 Dictionary *initWithContentsOfFile(const char *path);
62 Dictionary *autorelease();
64 void setObject(Object *object, String *forKey);
65 Object *objectForKey(String *key);
66 void removeObjectForKey(String *key);
67 void removeObjectForKey(const char *key);
69 void setObject(Object *object, const char *forKey);
70 Object *objectForKey(const char *key);
71 void setString(String *string, const char *forKey);
72 void setString(const char *string, const char *forKey);
73 String *stringForKey(String *key);
74 String *stringForKey(const char *key);
75 void setInteger(int value, String *key);
76 void setInteger(int value, const char *key);
77 int integerForKey(String *key);
78 int integerForKey(const char *key);
79 Dictionary *dictionaryForKey(String *key);
80 Dictionary *dictionaryForKey(const char *key);
81 Array *arrayForKey(String *key);
82 Array *arrayForKey(const char *key);
83 void setBool(bool value, String *key);
84 void setBool(bool value, const char *key);
85 bool boolForKey(String *key);
86 bool boolForKey(const char *key);
91 bool writeToFile(String *path, bool atomically);
92 bool writeToFile(const char *path, bool atomically);
94 std::string toString();
96 // virtual String *description();
97 virtual const char *className();