示例#1
0
 string& string::operator=(const TinySTL::string &str){
     if(this != &str){
         destroyAndDeallocate();
         allocateAndCopy(str.start_, str.finish_);
     }
     return *this;
 }
示例#2
0
文件: clabel.cpp 项目: avoin/mygit
void CLabel::set(const void* Str){

width((int)strlen((const char*)Str));
//deallocates the dynamic memory where the label's data has been stored
delete [] (char*)pdata();
//allocates dynamic memory for that data and copies the data in the newly allocated memory
allocateAndCopy((const char*)Str);
}
示例#3
0
CLine::CLine(int Row, int Col, int Width,
             int Maxdatalen, bool* Insertmode,
             bool Bordered,
             const char* Border): CField (Row, Col, Width, Bordered ? 3 : 1, NULL, Bordered, Border) {
    cursor=0;
    offset=0;
    _maxDatalen=Maxdatalen;
    //_insMode=Insertmode;
    allocateAndCopy("");
}
示例#4
0
void BigUnsigned::setBlock(Index i, Blk newBlock) {
	if (newBlock == 0) {
		if (i < len) {
			blk[i] = 0;
			zapLeadingZeros();
		}
		// If i >= len, no effect.
	} else {
		if (i >= len) {
			// The nonzero block extends the number.
			allocateAndCopy(i+1);
			// Zero any added blocks that we aren't setting.
			for (Index j = len; j < i; j++)
				blk[j] = 0;
			len = i+1;
		}
		blk[i] = newBlock;
	}
}
示例#5
0
void CLine::set(const void* Str) {
    if(alloc)
        delete [] (char*)pdata();
    allocateAndCopy((const char*)Str);
}
示例#6
0
文件: clabel.cpp 项目: avoin/mygit
CLabel::CLabel(int Row, int Col, int Len) : CField(Row,Col,Len){

allocateAndCopy("");

}
示例#7
0
文件: clabel.cpp 项目: avoin/mygit
CLabel::CLabel(const char *Str, int Row, int Col, int Len) : CField(Row,Col,Len==-1?strlen(Str):Len){

allocateAndCopy(Str);

}
示例#8
0
文件: clabel.cpp 项目: avoin/mygit
//A copy constructor which copies the source object's data 
//into the dynamic memory that stores the label's data	
CLabel::CLabel(const CLabel& L):CField(L){

	allocateAndCopy((char*)L.pdata());

}
示例#9
0
 string::string(const string &str, size_t pos, size_t len){
     len = changeVarWhenEuqalNPOS(len, str.size(), pos);
     allocateAndCopy(str.start_ + pos, str.start_ + pos + len);
 }
示例#10
0
 string& string::operator=(const char *s){
     destroyAndDeallocate();
     allocateAndCopy(s, s+strlen(s));
     return *this;
 }
示例#11
0
 string::string(const char* s, size_t n){
     allocateAndCopy(s, s+n);
     
 }
示例#12
0
 string::string(const char* s){
     allocateAndCopy(s, s + strlen(s));
 }
示例#13
0
	string::string(const string& str)
	{
		allocateAndCopy(str.start_, str.finish_);
	}