summaryrefslogtreecommitdiff
path: root/src/strings/rstring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/strings/rstring.cpp')
-rw-r--r--src/strings/rstring.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/strings/rstring.cpp b/src/strings/rstring.cpp
index c0e231e..3e5a46d 100644
--- a/src/strings/rstring.cpp
+++ b/src/strings/rstring.cpp
@@ -18,15 +18,22 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
+#include <cstdio>
+
#include "mstring.hpp"
+#include "astring.hpp"
#include "tstring.hpp"
#include "sstring.hpp"
#include "zstring.hpp"
#include "xstring.hpp"
-#include "vstring.hpp"
+#include "literal.hpp"
+// doing sneaky tricks here
//#include "../poison.hpp"
+
+namespace tmwa
+{
namespace strings
{
static_assert(sizeof(RString) == sizeof(const char *), "RString");
@@ -54,7 +61,7 @@ namespace strings
{
// order important for self-assign
r.owned->count++;
- // owned can be NULL from ctors
+ // owned can be nullptr from ctors
// TODO do ctors *properly* (requires gcc 4.7 to stay sane)
if (owned && !owned->count--)
::operator delete(owned);
@@ -125,6 +132,11 @@ namespace strings
else
_assign(x.begin(), x.end());
}
+ RString::RString(LString l)
+ : owned(nullptr)
+ {
+ *this = XString(l);
+ }
RString::iterator RString::begin() const
{
@@ -164,3 +176,4 @@ namespace strings
return len;
}
} // namespace strings
+} // namespace tmwa