PageRenderTime 17ms CodeModel.GetById 14ms app.highlight 2ms RepoModel.GetById 0ms app.codeStats 0ms

/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
10#include "LispString.h"
11#include <string.h>
12#include "Functions.h"
13using namespace Functions;
14
15LispString::LispString(const char* value){
16	this->value = new char[strlen(value) + 1];
17	strcpy(this->value, value);
18}
19LispString::LispString(const LispString &original):LispObject(original){
20	this->value = new char[strlen(original.value) + 1];
21	strcpy(this->value, original.value);
22}
23LispString::~LispString(){
24	delete[] value;
25}
26int LispString::getClassIdentifier(){
27	return LISPSTRING;
28}
29LispObject* LispString::copy(){
30	return new LispString(*this);
31}
32char* LispString::getString(){
33	return stringcpy(value);
34}