/LispString.cpp

https://bitbucket.org/hardtack/resoup · C++ · 34 lines · 24 code · 2 blank · 8 comment · 0 complexity · b56d538c6d5e4838a9f2c8753947c33c MD5 · raw file

  1. /*
  2. * LispString.cpp
  3. * Resoup
  4. *
  5. * Created by ??? on 10. 8. 18..
  6. * Copyright 2010 Unplug. All rights reserved.
  7. *
  8. */
  9. #include "LispString.h"
  10. #include <string.h>
  11. #include "Functions.h"
  12. using namespace Functions;
  13. LispString::LispString(const char* value){
  14. this->value = new char[strlen(value) + 1];
  15. strcpy(this->value, value);
  16. }
  17. LispString::LispString(const LispString &original):LispObject(original){
  18. this->value = new char[strlen(original.value) + 1];
  19. strcpy(this->value, original.value);
  20. }
  21. LispString::~LispString(){
  22. delete[] value;
  23. }
  24. int LispString::getClassIdentifier(){
  25. return LISPSTRING;
  26. }
  27. LispObject* LispString::copy(){
  28. return new LispString(*this);
  29. }
  30. char* LispString::getString(){
  31. return stringcpy(value);
  32. }