Working flat JString sorta

This commit is contained in:
Brad Arant committed 2023-10-09 19:31:12 -07:00
1 parent 7b333a3984
commit 74ab316e64
7 files changed
+65 -95

No files matched your search

+32 -17
View File
@@ -35,32 +35,47 @@ namespace coreutils {
JString();
JString(const char *data);
void set(ZString path, const char *value);
void set(ZString &path, ZString &value);
///
/// Use the find method to look through an object for member specified by
/// the key in parameter 1. The cursor must be pointing to the { character
/// the key in parameter 1. The cursor must be pointing to the { character
/// that begins the object's list.
///
ZString find(ZString path);
void operator=(ZString &value);
JString& operator=(const char *value);
JString& operator[](const char *path);
// operator const ZString () const {
// return *this;
// }
// MString & operator[](ZString &key);
// MString & operator[](std::string key);
ZString find(ZString &path);
private:
bool locate(ZString path);
bool locate(ZString &path);
bool notfirst;
MString path;
ZString path;
class Proxy {
public:
Proxy(JString &jstring, ZString key) : jstring(jstring), key(key) {}
operator coreutils::ZString () {
ZString result;
result = jstring.find(key);
return result;
}
Proxy& operator=(coreutils::ZString value) {
jstring.set(key, value);
return *this;
}
private:
JString &jstring;
ZString key;
};
public:
Proxy operator[](coreutils::ZString key) {
return Proxy(*this, key);
}
};