home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
GENMAN.ZIP
/
STRLOC.MAN
< prev
Wrap
Text File
|
1993-03-13
|
3KB
|
93 lines
STRLOC(base) BASE UTILITIES STRLOC(base)
Jun 19 16:39
NAME
strloc - class to manage strings
SYNOPSIS
#include <base/strloc.h>
class strloc
Public members
strloc( const char *str= 0 );
strloc( strloc & );
~strloc();
strloc & operator=( strloc & );
strloc & operator=( const char * );
void operator+=( const char * );
const char *ptr();
int len();
friend int operator==( const strloc &x, const char *s );
friend int operator==( const char *s, const strloc &x );
friend int operator==( const strloc &x, const strloc &y );
friend int operator!=( const strloc &x, const char *s );
friend int operator!=( const char *s, const strloc &x );
friend int operator!=( const strloc &x, const strloc &y );
Private members
strloc_data *st_com;
Pointer to character string struct.
DESCRIPTION
The strloc class is a class for managing strings.
It uses reference counts on copy operations.
SEE ALSO
strings(3)
STRUCTURES
struct strloc_data {
char *std_ptr; pointer to string
int std_refcnt; reference count
};
DEFINED MACROS
UTIL_STRLOC_H
INCLUDED FILES
<strings.hxx>
SOURCE FILES
strloc.cxx
strloc.h
SUMMARY
strloc::strloc( const char *newstr )
Normal constructor.
Passed a pointer to a character string it copies it
to new memory and sets the reference count to 1.
strloc::strloc( strloc &orig )
Constructor called when strloc a= b.
"this" is "a" and "orig" is a pointer to "b".
strloc::~strloc()
Destructor for the strloc class.
The refernce count is decrimented and when it goes to
zero the string is deleted.
strloc & strloc::operator=( strloc &rvalue )
Implements copy function.
Frees up old string and copies a pointer to the new one.
strloc & strloc::operator=( const char *newstr )
Implements set function: strloc a; a= "foo";
Frees up old string and copies a pointer to the new one.
void strloc::operator+=( const char *string )
Appends the specified string onto the end of the current string.
inline const char *strloc::ptr()
Returns the pointer to the string.
inline int strloc::len()
Returns the length of the string.
inline int operator==( const strloc &x, const strloc &y )
Returns 1 if the two strings are equal, 0 if not.
inline int operator!=( const strloc &x, const strloc &y )
Returns 1 if the two strings are not equal, 0 if equal.