Added makefiles, fixed template bug in nvault

This commit is contained in:
David Anderson
2005-08-02 09:48:06 +00:00
parent de5abef49a
commit 7eaa8a1a39
7 changed files with 163 additions and 9 deletions

View File

@ -33,6 +33,7 @@
#define _INCLUDE_CSTRING_H
#include <string.h>
#include <stdio.h>
//by David "BAILOPAN" Anderson
class String
@ -58,6 +59,13 @@ public:
assign(src);
}
const char * _fread(FILE *fp)
{
Grow(512, false);
char *ret = fgets(v, 511, fp);
return ret;
}
String(String &src)
{
v = NULL;
@ -122,7 +130,7 @@ public:
bool empty()
{
if (!v)
return false;
return true;
if (v[0] == '\0')
return true;
@ -270,7 +278,10 @@ public:
String substr(unsigned int index, int num = npos)
{
if (!v)
return String("");
{
String b("");
return b;
}
String ns;
@ -361,6 +372,8 @@ private:
strcpy(n, v);
if (v)
delete [] v;
else
strcpy(n, "");
v = n;
a_size = d + 1;
}