Lolly 1.4.28
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Friends | List of all members
string_rep Class Reference

#include <string.hpp>

Inheritance diagram for string_rep:
Inheritance graph
[legend]
Collaboration diagram for string_rep:
Collaboration graph
[legend]

Public Member Functions

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

Private Attributes

int n
 
chara
 
- Private Attributes inherited from concrete_struct
int ref_count
 The reference count for the concrete object.
 

Friends

class string
 
int N (string a)
 

Additional Inherited Members

- Private Member Functions inherited from concrete_struct
 concrete_struct ()
 Default constructor for the concrete object. Increments the reference count.
 
virtual ~concrete_struct ()
 Virtual destructor for the concrete object. Decrements the reference count.
 

Detailed Description

Definition at line 24 of file string.hpp.

Constructor & Destructor Documentation

◆ string_rep() [1/2]

string_rep::string_rep ( )
inline

Definition at line 29 of file string.hpp.

29: n (0), a (NULL) {}
The list class represents a linked list.
Definition list.hpp:48
char * a
Definition string.hpp:26

◆ string_rep() [2/2]

string_rep::string_rep ( int n)

Definition at line 34 of file string.cpp.

35 : n (n2),
36 a ((n == 0) ? ((char*) NULL) : tm_new_array<char> (round_length (n))) {}
int round_length(int n, size_t s)
Definition array.ipp:21
C * tm_new_array(int n)

◆ ~string_rep()

string_rep::~string_rep ( )
inline

Definition at line 31 of file string.hpp.

31 {
32 if (n != 0) tm_delete_array (a);
33 }
void tm_delete_array(C *Ptr)

Member Function Documentation

◆ resize()

void string_rep::resize ( int n)

Definition at line 39 of file string.cpp.

39 {
40 int nn= round_length (n);
41 int mm= round_length (m);
42 if (mm != nn) {
43 if (mm != 0) {
44 if (nn != 0) {
46 }
47 else {
49 }
50 }
51 else if (nn != 0) tm_delete_array (a);
52 }
53 n= m;
54}

Friends And Related Symbol Documentation

◆ string

Definition at line 36 of file string.hpp.

◆ N

int N ( string a)
friend

Definition at line 64 of file string.hpp.

64 {
65 return a->n;
66}

Member Data Documentation

◆ n

int string_rep::n
private

Definition at line 25 of file string.hpp.

◆ a

char* string_rep::a
private

Definition at line 26 of file string.hpp.


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