00001 /* -*- mode: c++; fill-column: 132; c-basic-offset: 4; indent-tabs-mode: nil -*- */ 00002 00003 00004 #include "eirods_tmp_string.h" 00005 00006 #include <string.h> 00007 00008 namespace eirods { 00009 00010 tmp_string::tmp_string( 00011 const char* orig) : string_(0){ 00012 00013 if(orig != 0) { 00014 int length = strlen(orig); 00015 string_ = new char[length + 1]; 00016 strncpy(string_, orig, length + 1); 00017 } 00018 } 00019 00020 00021 tmp_string::~tmp_string(void) { 00022 if(string_ != 0) { 00023 delete string_; 00024 } 00025 } 00026 00027 }; // namespace eirods