Revert "Remove mysql and oracle resources for anna-ericsson project"
[anna.git] / source / dbms / LongBlock.cpp
diff --git a/source/dbms/LongBlock.cpp b/source/dbms/LongBlock.cpp
new file mode 100644 (file)
index 0000000..da1796a
--- /dev/null
@@ -0,0 +1,48 @@
+// 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/core/functions.hpp>
+
+#include <anna/dbms/LongBlock.hpp>
+
+using namespace anna;
+
+dbms::LongBlock& dbms::LongBlock::operator = (const dbms::LongBlock & other)
+throw(RuntimeException) {
+  if(this == &other)
+    return *this;
+
+  if(other.isNull() == true) {
+    setNull(true);
+    return *this;
+  }
+
+  return operator= (other.a_value);
+}
+
+dbms::LongBlock& dbms::LongBlock::operator = (const anna::DataBlock & value)
+throw(RuntimeException) {
+  a_value = value;
+  setNull(a_value.isEmpty());
+  return *this;
+}
+
+std::string dbms::LongBlock::asString() const
+throw() {
+  std::string result("dbms::LongBlock { ");
+  result += dbms::Data::asString();
+  result += " | Size: ";
+
+  if(isNull())
+    result += "(null)";
+  else
+    result += functions::asString(a_value.getSize());
+
+  return result += " }";
+}
+