Revision 1106 trunk/src/tools99/string1.cpp

string1.cpp (revision 1106)
2 2
 * $Id$
3 3
 *
4 4
 * Author: David Fournier
5
 * Copyright (c) 2008-2012 Regents of the University of California 
5
 * Copyright (c) 2008-2012 Regents of the University of California
6 6
 */
7 7
#include <fvar.hpp>
8 8
#include <string.h>
......
54 54
  return (tmp);
55 55
}
56 56
#endif
57
 
57

  
58 58
adstring& adstring::operator=(const adstring & t)
59 59
{
60 60
  if (s != t.s)
......
105 105
    deallocate();
106 106
  }
107 107
};
108
 
108

  
109 109
unsigned char & adstring::operator()(const int i)
110 110
{
111 111
  if (i < 1 || i > (int) shape->size())
......
114 114
  }
115 115
  return ( ((unsigned char *)s)[i]);
116 116
}
117
 
117

  
118 118
#ifdef USE_CONST
119 119
const unsigned char& adstring::operator()(const int i) const
120 120
{
......
134 134
  return (s[i]);
135 135
}
136 136
#endif
137
 
137

  
138 138
#ifdef USE_CONST
139 139
int adstring::operator==(const adstring& v) const
140 140
{
......
142 142
  return (tmp == 0);
143 143
}
144 144
#endif
145
 
145

  
146 146
int adstring::operator==(const adstring& v)
147 147
{
148 148
  int tmp = strcmp (* this, v);
......
183 183
  }
184 184
  return (* this);
185 185
}
186
 
187 186

  
188 187
unsigned char& adstring::operator[](const int i)
189 188
{
......
196 195
 // return (s[i]);
197 196
  return ( ((unsigned char *)s)[i]);
198 197
}
199
 
198

  
200 199
int length(const adstring& t)
201 200
{
202 201
  return (int(t.size()));

Also available in: Unified diff