Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
delete not used const char * overloads
  • Loading branch information
NotFound committed May 29, 2012
1 parent 30a521d commit bc2376a
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 132 deletions.
2 changes: 0 additions & 2 deletions winxedxx.h
Expand Up @@ -164,13 +164,11 @@ WxxObjectPtr wxx_new(std::string name, WxxObjectArray args)
}

int wxx_print(int i) { std::cout << i; return 0; }
int wxx_print(const char *s) { std::cout << s; return 0; }
int wxx_print(const std::string &s) { std::cout << s; return 0; }
int wxx_print(double n) { std::cout << n; return 0; }
int wxx_print(WxxObjectPtr obj) { std::cout << obj.get_string(); return 0; }

int wxx_eprint(int i) { std::cerr << i; return 0; }
int wxx_eprint(const char *s) { std::cerr << s; return 0; }
int wxx_eprint(const std::string &s) { std::cerr << s; return 0; }
int wxx_eprint(double n) { std::cerr << n; return 0; }
int wxx_eprint(WxxObjectPtr obj) { std::cerr << obj.get_string(); return 0; }
Expand Down
37 changes: 1 addition & 36 deletions winxedxx_classes.cxx
Expand Up @@ -156,12 +156,6 @@ std::string WxxString::class_name() const

std::string WxxString::get_string() { return str; }

WxxObject & WxxString::set(const char *s)
{
str = s;
return *this;
}

WxxObject & WxxString::set(const std::string &s)
{
str = s;
Expand Down Expand Up @@ -289,12 +283,6 @@ WxxIntegerArray& WxxIntegerArray::push(double value)
return *this;
}

WxxIntegerArray& WxxIntegerArray::push(const char *str)
{
arr.push_back(atoi(str));
return *this;
}

WxxIntegerArray& WxxIntegerArray::push(const std::string &str)
{
arr.push_back(atoi(str.c_str()));
Expand Down Expand Up @@ -357,12 +345,6 @@ WxxFloatArray& WxxFloatArray::push(double value)
return *this;
}

WxxFloatArray& WxxFloatArray::push(const char *str)
{
arr.push_back(strtod(str, 0));
return *this;
}

WxxFloatArray& WxxFloatArray::push(const std::string &str)
{
arr.push_back(strtod(str.c_str(), 0));
Expand All @@ -386,7 +368,7 @@ WxxStringArray::WxxStringArray(char **argv) :
WxxArrayBase("ResizableStringArray")
{
for (int argi = 0; argv[argi]; ++argi)
push(argv[argi]);
push(std::string(argv[argi]));
}

WxxStringArray::~WxxStringArray()
Expand Down Expand Up @@ -438,12 +420,6 @@ WxxStringArray& WxxStringArray::push(double value)
return *this;
}

WxxStringArray& WxxStringArray::push(const char *str)
{
arr.push_back(std::string(str));
return *this;
}

WxxStringArray& WxxStringArray::push(const std::string &str)
{
arr.push_back(str);
Expand Down Expand Up @@ -520,12 +496,6 @@ WxxObjectArray& WxxObjectArray::push(double value)
return *this;
}

WxxObjectArray& WxxObjectArray::push(const char *str)
{
arr.push_back(new WxxObjectPtr(str));
return *this;
}

WxxObjectArray& WxxObjectArray::push(const std::string &str)
{
arr.push_back(new WxxObjectPtr(str));
Expand Down Expand Up @@ -554,11 +524,6 @@ WxxObjectPtr WxxHash::get_pmc_keyed(const std::string &s)
return hsh[s];
}

WxxObjectPtr WxxHash::get_pmc_keyed(const char *s)
{
return hsh[s];
}

WxxObjectPtr & WxxHash::set_pmc_keyed(const std::string &s, const WxxObjectPtr &value)
{
hsh[s] = value;
Expand Down
17 changes: 0 additions & 17 deletions winxedxx_default.cxx
Expand Up @@ -19,11 +19,6 @@ WxxDefault::WxxDefault()
throw std::runtime_error("Default instantiated");
}

WxxDefault::WxxDefault(const char *name)
{
this->name = name;
}

WxxDefault::WxxDefault(const std::string &name)
{
this->name = name;
Expand Down Expand Up @@ -96,12 +91,6 @@ WxxObject & WxxDefault::set(double value)
return *this;
}

WxxObject & WxxDefault::set(const char *s)
{
notimplemented("set");
return *this;
}

WxxObject & WxxDefault::set(const std::string &s)
{
notimplemented("set");
Expand Down Expand Up @@ -147,12 +136,6 @@ WxxObjectPtr WxxDefault::get_pmc_keyed(const std::string &s)
return winxedxxnull;
}

WxxObjectPtr WxxDefault::get_pmc_keyed(const char *s)
{
notimplemented("get_pmc_keyed");
return winxedxxnull;
}

void WxxDefault::set_pmc_keyed(int i, const WxxObjectPtr &value)
{
notimplemented("set_pmc_keyed");
Expand Down
3 changes: 0 additions & 3 deletions winxedxx_default.h
Expand Up @@ -12,7 +12,6 @@ class WxxDefault : public WxxObject
{
protected:
WxxDefault();
WxxDefault(const char *name);
WxxDefault(const std::string &name);
~WxxDefault();
public:
Expand All @@ -28,7 +27,6 @@ class WxxDefault : public WxxObject
int is_equal(const WxxObject &to);
WxxObject & set(int value);
WxxObject & set(double value);
WxxObject & set(const char *s);
WxxObject & set(const std::string &s);
void increment();
void decrement();
Expand All @@ -37,7 +35,6 @@ class WxxDefault : public WxxObject
std::string get_string_keyed(int i);
WxxObjectPtr get_pmc_keyed(int i);
WxxObjectPtr get_pmc_keyed(const std::string &s);
WxxObjectPtr get_pmc_keyed(const char *s);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
int exists(const std::string &key);
Expand Down
10 changes: 0 additions & 10 deletions winxedxx_integer.h
Expand Up @@ -13,19 +13,16 @@ namespace WinxedXX
int wxx_int_cast(int i);
int wxx_int_cast(double n);
int wxx_int_cast(const std::string &str);
int wxx_int_cast(const char *str);
int wxx_int_cast(const WxxObjectPtr &obj);

double wxx_num_cast(int i);
double wxx_num_cast(double n);
double wxx_num_cast(const std::string &str);
double wxx_num_cast(const char *str);
double wxx_num_cast(const WxxObjectPtr &obj);

std::string www_string_cast(int i);
std::string www_string_cast(double n);
std::string wxx_string_cast(const std::string &str);
std::string wxx_string_cast(const char *str);
std::string wxx_string_cast(const WxxObjectPtr &obj);

std::string wxx_repeat_string(std::string s, int n);
Expand Down Expand Up @@ -69,7 +66,6 @@ class WxxString : public WxxDefault
WxxString(std::string value);
std::string class_name() const;
std::string get_string();
WxxObject & set(const char *s);
WxxObject & set(const std::string &s);
WxxObjectPtr get_iter();
private:
Expand All @@ -85,7 +81,6 @@ class WxxArrayBase : public WxxDefault
virtual WxxArrayBase& push(WxxObjectPtr obj) = 0;
virtual WxxArrayBase& push(int i) = 0;
virtual WxxArrayBase& push(double value) = 0;
virtual WxxArrayBase& push(const char *str) = 0;
virtual WxxArrayBase& push(const std::string &str) = 0;
virtual void set_pmc_keyed(int i, const WxxObjectPtr &value) = 0;
WxxObjectPtr get_iter();
Expand All @@ -102,7 +97,6 @@ class WxxIntegerArray : public WxxArrayBase
WxxIntegerArray& push(WxxObjectPtr obj);
WxxIntegerArray& push(int i);
WxxIntegerArray& push(double value);
WxxIntegerArray& push(const char *str);
WxxIntegerArray& push(const std::string &str);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
private:
Expand All @@ -120,7 +114,6 @@ class WxxFloatArray : public WxxArrayBase
WxxFloatArray& push(WxxObjectPtr obj);
WxxFloatArray& push(int i);
WxxFloatArray& push(double value);
WxxFloatArray& push(const char *str);
WxxFloatArray& push(const std::string &str);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
private:
Expand All @@ -140,7 +133,6 @@ class WxxStringArray : public WxxArrayBase
WxxStringArray& push(WxxObjectPtr obj);
WxxStringArray& push(int i);
WxxStringArray& push(double value);
WxxStringArray& push(const char *str);
WxxStringArray& push(const std::string &str);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
WxxObjectPtr call_method(const std::string &methname, WxxObjectArray &args);
Expand All @@ -159,7 +151,6 @@ class WxxObjectArray : public WxxArrayBase
WxxObjectArray& push(WxxObjectPtr obj);
WxxObjectArray& push(int i);
WxxObjectArray& push(double value);
WxxObjectArray& push(const char *str);
WxxObjectArray& push(const std::string &str);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
private:
Expand Down Expand Up @@ -198,7 +189,6 @@ class WxxHash : public WxxDefault
using WxxDefault::set_pmc_keyed;
WxxObjectPtr &set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
WxxObjectPtr get_pmc_keyed(const std::string &s);
WxxObjectPtr get_pmc_keyed(const char *s);
int exists(const std::string &key);
private:
std::map<std::string, WxxObjectPtr> hsh;
Expand Down
12 changes: 0 additions & 12 deletions winxedxx_null.cxx
Expand Up @@ -74,12 +74,6 @@ WxxObject & WxxNull::set(double value)
return *this;
}

WxxObject & WxxNull::set(const char *s)
{
nullaccess("set");
return *this;
}

WxxObject & WxxNull::set(const std::string &s)
{
nullaccess("set");
Expand Down Expand Up @@ -126,12 +120,6 @@ WxxObjectPtr WxxNull::get_pmc_keyed(const std::string &s)
return winxedxxnull;
}

WxxObjectPtr WxxNull::get_pmc_keyed(const char *s)
{
nullaccess("get_pmc_keyed");
return winxedxxnull;
}

void WxxNull::set_pmc_keyed(int i, const WxxObjectPtr &value)
{
nullaccess("set_pmc_keyed");
Expand Down
2 changes: 0 additions & 2 deletions winxedxx_null.h
Expand Up @@ -22,7 +22,6 @@ class WxxNull : public WxxObject
int is_equal(const WxxObject &to);
WxxObject & set(int value);
WxxObject & set(double value);
WxxObject & set(const char *s);
WxxObject & set(const std::string &s);
void increment();
void decrement();
Expand All @@ -31,7 +30,6 @@ class WxxNull : public WxxObject
std::string get_string_keyed(int i);
WxxObjectPtr get_pmc_keyed(int i);
WxxObjectPtr get_pmc_keyed(const std::string &s);
WxxObjectPtr get_pmc_keyed(const char *s);
void set_pmc_keyed(int i, const WxxObjectPtr &value);
int exists(const std::string &key);
WxxObjectPtr & set_pmc_keyed(const std::string &s, const WxxObjectPtr &value);
Expand Down
2 changes: 0 additions & 2 deletions winxedxx_object.h
Expand Up @@ -21,7 +21,6 @@ class WxxObject : public WxxRefcounted
virtual int is_equal(const WxxObject &to) = 0;
virtual WxxObject & set(int value) = 0;
virtual WxxObject & set(double value) = 0;
virtual WxxObject & set(const char *s) = 0;
virtual WxxObject & set(const std::string &s) = 0;
virtual void increment() = 0;
virtual void decrement() = 0;
Expand All @@ -30,7 +29,6 @@ class WxxObject : public WxxRefcounted
virtual std::string get_string_keyed(int i) = 0;
virtual WxxObjectPtr get_pmc_keyed(int i) = 0;
virtual WxxObjectPtr get_pmc_keyed(const std::string &s) = 0;
virtual WxxObjectPtr get_pmc_keyed(const char *s) = 0;
virtual void set_pmc_keyed(int i, 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;
Expand Down
36 changes: 0 additions & 36 deletions winxedxx_objectptr.cxx
Expand Up @@ -32,12 +32,6 @@ WxxObjectPtr::WxxObjectPtr(const std::string &value) :
object->incref();
}

WxxObjectPtr::WxxObjectPtr(const char *value) :
object(new WxxString(value))
{
object->incref();
}

WxxObjectPtr::WxxObjectPtr(const WxxObjectPtr &old) :
object(old.object)
{
Expand Down Expand Up @@ -87,12 +81,6 @@ WxxObjectPtr & WxxObjectPtr::set(double value)
return *this;
}

WxxObjectPtr & WxxObjectPtr::set(const char *s)
{
object->set(s);
return *this;
}

WxxObjectPtr & WxxObjectPtr::set(const std::string &s)
{
object->set(s);
Expand Down Expand Up @@ -131,14 +119,6 @@ WxxObjectPtr & WxxObjectPtr::operator = (const std::string &s)
return *this;
}

WxxObjectPtr & WxxObjectPtr::operator = (const char *s)
{
object->decref();
object = new WxxString(s);
object->incref();
return *this;
}

int WxxObjectPtr::is_equal (const WxxObjectPtr &from) const
{
if (object == from.object)
Expand Down Expand Up @@ -228,11 +208,6 @@ WxxObjectPtr WxxObjectPtr::get_pmc_keyed(const std::string &s)
return object->get_pmc_keyed(s);
}

WxxObjectPtr WxxObjectPtr::get_pmc_keyed(const char *s)
{
return object->get_pmc_keyed(s);
}

WxxObjectPtr WxxObjectPtr::get_pmc_keyed(const WxxObjectPtr & key)
{
return object->get_pmc_keyed(std::string(key));
Expand Down Expand Up @@ -268,11 +243,6 @@ void WxxObjectPtr::set_attr_str(const std::string &s, const WxxObjectPtr &value)
object->set_attr_str(s, value);
}

void WxxObjectPtr::set_attr_str(const char *s, const WxxObjectPtr &value)
{
object->set_attr_str(s, value);
}

WxxObjectPtr WxxObjectPtr::get_iter()
{
return object->get_iter();
Expand Down Expand Up @@ -301,12 +271,6 @@ void WxxObjectPtr::push(double value)
arr->push(value);
}

void WxxObjectPtr::push(const char *str)
{
if (WxxArrayBase *arr = dynamic_cast<WxxArrayBase *>(object))
arr->push(str);
}

void WxxObjectPtr::push(const std::string &str)
{
if (WxxArrayBase *arr = dynamic_cast<WxxArrayBase *>(object))
Expand Down

0 comments on commit bc2376a

Please sign in to comment.