substring method
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -93,6 +93,7 @@ public:
|
|||||||
void remove(const int ind);
|
void remove(const int ind);
|
||||||
void remove(const int ind1, const int ind2);
|
void remove(const int ind1, const int ind2);
|
||||||
void substring(const int ind1, const int ind2, amsstring *sout) const;
|
void substring(const int ind1, const int ind2, amsstring *sout) const;
|
||||||
|
amsstring substring(const int ind1, const int ind2) const;
|
||||||
|
|
||||||
//Append
|
//Append
|
||||||
void append(const amsstring &other);
|
void append(const amsstring &other);
|
||||||
|
|||||||
@ -654,6 +654,13 @@ namespace ams
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
amsstring amsstring::substring(const int ind1, const int ind2) const
|
||||||
|
{
|
||||||
|
amsstring ret;
|
||||||
|
this->substring(ind1,ind2,&ret);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
void amsstring::append(const amsstring &other)
|
void amsstring::append(const amsstring &other)
|
||||||
{
|
{
|
||||||
this->insert(this->length,other);
|
this->insert(this->length,other);
|
||||||
|
|||||||
@ -140,7 +140,7 @@ int amssprintf_s(char *s, int n, const char *format, ...)
|
|||||||
//va_arg(val,datatype)
|
//va_arg(val,datatype)
|
||||||
// if(s!=NULL)
|
// if(s!=NULL)
|
||||||
// {
|
// {
|
||||||
#if defined(LINUX) || defined(linux) || defined(__linux__) || defined(__GNUC__)
|
#if defined(LINUX) || defined(linux) || defined(__linux__) || defined(__GNUC__) || defined(__APPLE__) || defined(__MACH__)
|
||||||
//use snprintf
|
//use snprintf
|
||||||
ret = (int)vsnprintf(s,n,format,args);
|
ret = (int)vsnprintf(s,n,format,args);
|
||||||
s[n-1] = '\0';
|
s[n-1] = '\0';
|
||||||
|
|||||||
Reference in New Issue
Block a user