Category : C++ Source Code
Archive   : STRX.ZIP
Filename : BCSTR.CPP
Output of file : BCSTR.CPP contained in archive : STRX.ZIP
// BCstr.cpp -- Borland object based str implementation
// Author : Roy S. Woll
//
// Copyright (c) 1993 by Roy S. Woll
// You may distribute this source freely as long as you leave all files
// in their original form, including the copyright notice as is.
//
// Version 1.00 10/20/92
//
#include "BCstr.h"
#include
BCstr::BCstr (void):str(){};
BCstr::BCstr (int p_bufsize, int p_incr):str(p_bufsize, p_incr){};
BCstr::BCstr (const char * s, int p_bufsize, int p_incr):
str(s,p_bufsize, p_incr){};
BCstr::BCstr (const str& s, int p_bufsize, int p_incr):
str(s,p_bufsize, p_incr){};
BCstr::BCstr (const BCstr& s, int p_bufsize, int p_incr):
str(s, p_bufsize, p_incr){};
// Relational Operators
int BCstr::isLessThan(const Object& b) const{
return compare(*this, (BCstr &) b)<0;
};
int BCstr::isEqual(const Object& b) const{
return compare(*this, (BCstr &) b)==0;
};
hashValueType BCstr::hashValue() const // use Borland's String hash function
{
hashValueType value = hashValueType(0);
for( int i = 0; i < length(); i++ )
{
value ^= data->buf[i];
value = _rotl( value, 1 );
}
return value;
}
void BCstr::printOn( ostream& outputStream ) const
{
outputStream << (str&)*this;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/