--- /dev/null
+// ANNA - Anna is Not Nothingness Anymore //
+// //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo //
+// //
+// See project site at http://redmine.teslayout.com/projects/anna-suite //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
+
+
+#include <anna/dbms/String.hpp>
+
+using namespace anna;
+using namespace anna::dbms;
+
+String& String::operator = (const String & other)
+throw(RuntimeException) {
+ if(this == &other)
+ return *this;
+
+ if(other.isNull() == true) {
+ setNull(true);
+ a_value [0] = 0;
+ return *this;
+ }
+
+ return operator= (other.a_value);
+}
+
+String& String::operator = (const char * str)
+throw(RuntimeException) {
+ if(a_value != str) {
+ if(anna_strlen(str) > Data::getMaxSize())
+ throw RuntimeException(
+ functions::asString("'%s' out of range | MaxLen: %d | Len: %d ", str, Data::getMaxSize(), anna_strlen(str)),
+ ANNA_FILE_LOCATION
+ );
+
+ anna_strcpy(a_value, str);
+ }
+
+ Data::setNull(false);
+ return *this;
+}
+
+char* String::strip(char *str)
+throw() {
+ int len;
+
+ if(str == NULL || (len = anna_strlen(str)) == 0)
+ return str;
+
+ int end = len - 1;
+
+ while(end >= 0 && str [end] == ' ') end --;
+
+ if(end >= 0)
+ str [++ end] = 0;
+
+ return str;
+}
+
+std::string dbms::String::asString() const
+throw() {
+ std::string result("dbms::String { ");
+ result += dbms::Data::asString();
+ result += " | Value: ";
+ result += a_value;
+ return result += " }";
+}
+