Permalink
Browse files

improve a bit set_pmc_keyed string and implement it in Namespace

  • Loading branch information...
1 parent 15dc476 commit 843cfbdd459efa9f8004f048c29662afc62c2f6e @NotFound committed Jun 3, 2012
View
@@ -88,10 +88,9 @@ WxxObjectPtr WxxHash::get_pmc_keyed(const std::string &s)
return hsh[s];
}
-WxxObjectPtr & WxxHash::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
+void WxxHash::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
{
hsh[s] = value;
- return hsh[s];
}
int WxxHash::exists(const std::string &key)
View
@@ -168,10 +168,9 @@ void WxxDefault::set_pmc_keyed(int i, const WxxObjectPtr &value)
notimplemented("set_pmc_keyed_int");
}
-WxxObjectPtr & WxxDefault::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
+void WxxDefault::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
{
notimplemented("set_pmc_keyed_str");
- return winxedxxnull;
}
int WxxDefault::exists(const std::string &key)
{
View
@@ -41,7 +41,7 @@ class WxxDefault : public WxxObject
WxxObjectPtr get_pmc_keyed(const std::string &s);
WxxObjectPtr get_pmc_keyed(const WxxObjectPtr &key);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
- WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
+ void set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
int exists(const std::string &key);
WxxObjectPtr & get_attr_str(const std::string &s);
void set_attr_str(const std::string &s, const WxxObjectPtr &value);
View
@@ -200,7 +200,7 @@ class WxxHash : public WxxDefault
WxxHash & set(const std::string &key, WxxObjectPtr value);
int elements() const;
using WxxDefault::set_pmc_keyed;
- WxxObjectPtr &set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
+ void set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
WxxObjectPtr get_pmc_keyed(const std::string &s);
int exists(const std::string &key);
private:
View
@@ -59,6 +59,11 @@ WxxObjectPtr WxxNamespace::get_pmc_keyed(const std::string &s)
return get(s);
}
+void WxxNamespace::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
+{
+ set(s, value);
+}
+
WxxObjectPtr WxxNamespace::call_method(const std::string &methname, WxxObjectArray &args)
{
if (methname == "get_parent")
View
@@ -31,6 +31,8 @@ class WxxNamespace : public WxxDefault
// vtable functions
std::string get_string();
WxxObjectPtr get_pmc_keyed(const std::string &s);
+ void set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
+
WxxObjectPtr call_method(const std::string &methname, WxxObjectArray &args);
const std::string name;
View
@@ -153,10 +153,9 @@ void WxxNull::set_pmc_keyed(int i, const WxxObjectPtr &value)
nullaccess("set_pmc_keyed_int");
}
-WxxObjectPtr & WxxNull::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
+void WxxNull::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
{
nullaccess("set_pmc_keyed_str");
- return winxedxxnull;
}
int WxxNull::exists(const std::string &key)
View
@@ -36,8 +36,8 @@ class WxxNull : public WxxObject
WxxObjectPtr get_pmc_keyed(const std::string &s);
WxxObjectPtr get_pmc_keyed(const WxxObjectPtr &key);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
+ void set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
int exists(const std::string &key);
- WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
WxxObjectPtr & get_attr_str(const std::string &s);
void set_attr_str(const std::string &s, const WxxObjectPtr &value);
WxxObjectPtr get_iter();
View
@@ -35,8 +35,8 @@ class WxxObject : public WxxRefcounted
virtual WxxObjectPtr get_pmc_keyed(const std::string &s) = 0;
virtual WxxObjectPtr get_pmc_keyed(const WxxObjectPtr &key) = 0;
virtual void set_pmc_keyed(int i, const WxxObjectPtr &value) = 0;
+ virtual void set_pmc_keyed(const std::string &s, const WxxObjectPtr &value) = 0;
virtual int exists(const std::string &key) = 0;
- virtual WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value) = 0;
virtual WxxObjectPtr & get_attr_str(const std::string &s) = 0;
virtual void set_attr_str(const std::string &s, const WxxObjectPtr &value) = 0;
virtual WxxObjectPtr get_iter() = 0;
View
@@ -235,16 +235,16 @@ void WxxObjectPtr::set_pmc_keyed(int i, const WxxObjectPtr &value) const
object->set_pmc_keyed(i, value);
}
-WxxObjectPtr & WxxObjectPtr::set_pmc_keyed(const std::string &s,
+void WxxObjectPtr::set_pmc_keyed(const std::string &s,
const WxxObjectPtr &value) const
{
- return object->set_pmc_keyed(s, value);
+ object->set_pmc_keyed(s, value);
}
-WxxObjectPtr & WxxObjectPtr::set_pmc_keyed(const WxxObjectPtr &key,
+void WxxObjectPtr::set_pmc_keyed(const WxxObjectPtr &key,
const WxxObjectPtr &value) const
{
- return object->set_pmc_keyed(key.get_string(), value);
+ object->set_pmc_keyed(key.get_string(), value);
}
int WxxObjectPtr::exists(const std::string &key) const
View
@@ -90,8 +90,8 @@ class WxxObjectPtr
WxxObjectPtr get_pmc_keyed(const std::string &s) const;
WxxObjectPtr get_pmc_keyed(const WxxObjectPtr &key) const;
void set_pmc_keyed(int i, const WxxObjectPtr &value) const;
- WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value) const;
- WxxObjectPtr & set_pmc_keyed(const WxxObjectPtr &key, const WxxObjectPtr &value) const;
+ void set_pmc_keyed(const std::string &s, const WxxObjectPtr &value) const;
+ void set_pmc_keyed(const WxxObjectPtr &key, const WxxObjectPtr &value) const;
int exists(const std::string &key) const;
WxxObjectPtr & get_attr_str(const std::string &s) const;
void set_attr_str(const std::string &s, const WxxObjectPtr &value) const;
@@ -145,6 +145,7 @@ int wxx_indexof(const std::string &from, const std::string &search);
int wxx_indexof(const std::string &from, const std::string &search, int pos);
std::string wxx_chomp(const std::string &src);
+
std::string wxx_escape(const std::string &src);
WxxObjectPtr wxx_new(const std::string &name);

0 comments on commit 843cfbd

Please sign in to comment.