File: string.hh%2Cv

package info (click to toggle)
abacus 0.9.13-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 6,308 kB
  • ctags: 5,120
  • sloc: ansic: 27,540; cpp: 11,426; tcl: 7,564; makefile: 386; yacc: 327; lex: 265; sh: 221
file content (199 lines) | stat: -rw-r--r-- 3,426 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
head	1.2;
access;
symbols
	V0_9_13:1.2
	V0_9_11:1.2
	V0_9_10:1.2
	V0_9_9:1.2
	V0_9_8:1.2
	V0_9_7:1.2
	V0_9_6:1.2
	V0_9_4:1.2
	V0_9_3:1.2
	V0_9_2:1.2
	V0_9_1:1.2
	V0_8_23:1.2
	V0_8_22:1.2
	V0_8_20:1.2
	V0_8_19:1.2
	V0_8_18:1.2
	V0_8_16:1.2
	V0_8_14:1.2
	V0_8_13:1.2
	V0_8_12:1.2
	V0_8_11:1.2
	V0_8_10:1.2
	V0_8_9:1.2
	V0_8_8:1.2
	V0_8_7:1.2
	V0_8_6:1.2
	V0_8_5:1.2
	V0_8_4:1.2
	V0_8_3:1.2
	V0_8_2:1.2
	V0_8_1:1.2
	V0_8_0:1.2
	V0_7_9:1.2
	V0_7_8:1.2
	V0_7_7:1.2
	V0_7_6:1.2
	V0_7_4:1.2
	V0_7_3:1.2
	V0_7_2:1.2
	V0_7_1:1.2
	V0_7_0:1.2
	V0_6_9:1.2
	V0_6_8:1.2
	V0_6_7:1.2
	V0_6_6:1.2
	V0_6_5:1.2
	V0_6_4:1.2
	V0_6_3:1.2
	V0_6_2:1.2
	V0_6_1:1.2
	V0_6_10:1.2
	v0_5_10:1.2
	V0_5_9:1.2
	V0_5_7:1.2
	V0_5_6:1.2
	V0_5_5:1.2
	V0_5_4:1.2
	V0_5_3:1.2
	V0_5_2:1.2
	V0_5_1:1.2
	V0_5_0:1.2
	V0_4_9:1.2
	V0_4_8:1.2
	V0_4_7:1.1;
locks
	fred:1.2; strict;
comment	@//@;


1.2
date	96.01.02.16.22.09;	author aml;	state Exp;
branches;
next	1.1;

1.1
date	95.12.30.14.53.29;	author aml;	state Exp;
branches;
next	;


desc
@@


1.2
log
@Formula compilation, evaluation and decompilation now work.
Cells can be of type label, numerical formula or numbers.
@
text
@// $Header: /home/aml/src/common/xxl/src/include/RCS/string.hh,v 1.1 1995/12/30 14:53:29 aml Exp aml $
/**************************************************************

Program: SMOG - Selection of Minimal Ordered Graphs

Author: Arlindo Oliveira (aml@@ic.eecs.berkeley.edu)

Copyright 1994 University of California Berkeley / CAD Group

This software may not be distributed without 
permission of the copyright holder.


****************************************************************/

#ifndef _STRING_DOT_HH_
#define _STRING_DOT_HH_

#include "string.h"
#include "utils.hh"

class string {
  public:
    char *ptr;
    string(int n) {
        ptr = new char[n];
    }
    string() {
        ptr = NULL;
    }
    string(char *st) {
        int size = strlen(st)+1;
        ptr = new char[size];
        strcpy(ptr,st);
    }
    ~string(){
        delete [] ptr;
    }
    operator char*() {return(ptr);}
    void operator+=(const string &right) {
        char *ax;

        ax = ptr;

        int size = strlen(ptr)+strlen(right.ptr)+2;
        ptr = new char[size];

        strcpy(ptr,ax);
        strcat(ptr,right.ptr);    
        delete [] ax;
    }
    void operator=(const string &right) {
        delete [] ptr;
        if (right.ptr != NULL) {
            ptr = new char[strlen(right.ptr)+1];
            strcpy(ptr,right.ptr);
        }
        else ptr = right.ptr;
    }
    operator==(const string &right) {
      return
        strcmp(ptr,right.ptr) != 0 ? 0 : 1;
    }
    operator!=(const string &right) {
      return
        strcmp(ptr,right.ptr) != 0 ? 1 : 0;
    }
    string(const string &right) {
        ptr = new char[strlen(right.ptr)+1];
        strcpy(ptr,right.ptr);
    }
    int len() {
        return(strlen(ptr));
    }
    char &operator[](int i) {
        return(ptr[i]);
    }
friend ostream &operator<<(ostream &s, string &st) ;
};

#endif // _STRING_DOT_HH_

// $Log: string.hh,v $
//Revision 1.1  1995/12/30  14:53:29  aml
//Initial revision
//
//Revision 1.2  1994/09/10  16:04:16  aml
//Made changes to compile on hp.
//
//Revision 1.1  94/09/08  00:01:34  00:01:34  aml
//Initial revision
//
@


1.1
log
@Initial revision
@
text
@d1 1
a1 1
// $Header: /home/aml/src/common/smog/RCS/string.hh,v 1.2 1994/09/10 16:04:16 aml Exp $
d48 1
d84 3
@