diff options
| author | Dana Jansens <danakj@orodu.net> | 2002-05-24 18:19:22 +0000 |
|---|---|---|
| committer | Dana Jansens <danakj@orodu.net> | 2002-05-24 18:19:22 +0000 |
| commit | 18bdbfaad269fe7ab688194739391695b874bbd1 (patch) | |
| tree | 4910dd1ef5ffb5848493a0f2742aabcf3384f1dd /src/XAtom.cc | |
| parent | 120d8e5ac3132ff8b4bd4ca55b3554c55120a16e (diff) | |
better string get/set
Diffstat (limited to 'src/XAtom.cc')
| -rw-r--r-- | src/XAtom.cc | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/XAtom.cc b/src/XAtom.cc index 0f36ef9b..9e590126 100644 --- a/src/XAtom.cc +++ b/src/XAtom.cc @@ -182,7 +182,8 @@ void XAtom::setPixmapValue(Window win, Atom atom, Pixmap value) const { /* * Set a string property value on a window. */ -void XAtom::setStringValue(Window win, Atom atom, std::string &value) const { +void XAtom::setStringValue(Window win, Atom atom, + const std::string &value) const { setValue(win, atom, XA_STRING, const_cast<unsigned char*> (reinterpret_cast<const unsigned char*>(value.c_str())), @@ -229,7 +230,8 @@ void XAtom::addPixmapValue(Window win, Atom atom, Pixmap value) const { /* * Add characters to a string property value on a window. */ -void XAtom::addStringValue(Window win, Atom atom, std::string &value) const { +void XAtom::addStringValue(Window win, Atom atom, + const std::string &value) const { setValue(win, atom, XA_STRING, const_cast<unsigned char*> (reinterpret_cast<const unsigned char *> @@ -328,10 +330,10 @@ bool XAtom::getPixmapValue(Window win, Atom atom, unsigned long *nelements, /* * Gets an string property's value from a window. */ -bool XAtom::getStringValue(Window win, Atom atom, unsigned long *nelements, - std::string &value) const { +bool XAtom::getStringValue(Window win, Atom atom, std::string &value) const { unsigned char *data; - bool ret = XAtom::getValue(win, atom, XA_STRING, nelements, &data, 8); + unsigned long nelements; + bool ret = XAtom::getValue(win, atom, XA_STRING, &nelements, &data, 8); if (ret) value = reinterpret_cast<char*>(data); return ret; |
