Пример #1
0
uSHORT  baseArray_C::setAlloc(uSHORT numObjs)
{

    uSHORT      retVal = 0;

    if ((numObjs > 0) && (objSize > 0) && (numObjs >= objCount)) {
        // Allocate a new buffer
        uCHAR *newBuff_P = new uCHAR[(numObjs+1)*objSize];
        // If the new buffer was allocated...
        if (newBuff_P != (uCHAR *)NULL) {
            retVal = 1;
            // If an old buffer exists...
            if (buff_P != (uCHAR *)NULL) {
                // Copy the old buffer data to the new buffer
                memcpy(newBuff_P,buff_P,objCount*objSize);
                // Free the old buffer
                freeBuff();
            }
            // Set the total # of objects allocated
            totalObjs = numObjs;
            // Set the array buffer pointer
            buff_P = newBuff_P;
        }
    }

    return (retVal);

}
Пример #2
0
mstring& mstring::operator=(const mstring& rhs){
    if (this == &rhs) {
        return *this;
    }
    freeBuff();
    initWithBuf(rhs);
    return *this;
}
Пример #3
0
void    baseArray_C::reAlloc()
{

    // Free the current object buffer
    freeBuff();
    // Zero the object count
    objCount =
    // Zero the object allocation size
    totalObjs = 0;

}
Пример #4
0
baseArray_C::~baseArray_C()
{

    freeBuff();

}
Пример #5
0
mstring::~mstring(){
    freeBuff();
}