1 // ANNA - Anna is Not Nothingness Anymore //
3 // (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
5 // See project site at http://redmine.teslayout.com/projects/anna-suite //
6 // See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
9 #include <anna/dbms/String.hpp>
12 using namespace anna::dbms;
14 String& String::operator = (const String & other)
15 throw(RuntimeException) {
19 if(other.isNull() == true) {
25 return operator= (other.a_value);
28 String& String::operator = (const char * str)
29 throw(RuntimeException) {
31 if(anna_strlen(str) > Data::getMaxSize())
32 throw RuntimeException(
33 functions::asString("'%s' out of range | MaxLen: %d | Len: %d ", str, Data::getMaxSize(), anna_strlen(str)),
37 anna_strcpy(a_value, str);
44 char* String::strip(char *str)
48 if(str == NULL || (len = anna_strlen(str)) == 0)
53 while(end >= 0 && str [end] == ' ') end --;
61 std::string dbms::String::asString() const
63 std::string result("dbms::String { ");
64 result += dbms::Data::asString();
65 result += " | Value: ";
67 return result += " }";