Back to index

Public Member Functions | Private Attributes | Friends
string_rep Class Reference

#include <string.hpp>

Inheritance diagram for string_rep:
Inheritance graph
Collaboration diagram for string_rep:
Collaboration graph

List of all members.

Public Member Functions

 string_rep ()
 string_rep (int n)
 ~string_rep ()
void resize (int n)

Private Attributes

int n
char * a
int ref_count


class string
int N (string a)

Detailed Description

Definition at line 18 of file string.hpp.

Constructor & Destructor Documentation

string_rep::string_rep ( ) [inline]

Definition at line 23 of file string.hpp.

: n(0), a(NULL) {}

Definition at line 31 of file string.cpp.

  n(n2), a ((n==0)?((char*) NULL):tm_new_array<char> (round_length(n))) {}

Definition at line 25 of file string.hpp.

{ if (n!=0) tm_delete_array (a); }

Here is the call graph for this function:

Member Function Documentation

void string_rep::resize ( int  n)

Definition at line 35 of file string.cpp.

  register int nn= round_length (n);
  register int mm= round_length (m);
  if (mm != nn) {
    if (mm != 0) {
      register int i, k= (m<n? m: n);
      char* b= tm_new_array<char> (mm);
      for (i=0; i<k; i++) b[i]= a[i];
      if (nn != 0) tm_delete_array (a);
      a= b;
    else if (nn != 0) tm_delete_array (a);
  n= m;

Here is the call graph for this function:

Friends And Related Function Documentation

int N ( string  a) [friend]

Definition at line 48 of file string.hpp.

{ return a->n; }
friend class string [friend]

Definition at line 28 of file string.hpp.

Member Data Documentation

char* string_rep::a [private]

Definition at line 20 of file string.hpp.

int string_rep::n [private]

Definition at line 19 of file string.hpp.

int concrete_struct::ref_count [inherited]

Definition at line 135 of file basic.hpp.

The documentation for this class was generated from the following files: