mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
Merge 0.6.6 branch into main.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@7187 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
3e7e30415a
commit
a051ddd885
71 changed files with 4888 additions and 5571 deletions
|
@ -800,6 +800,77 @@ static IMP msInitImp; /* designated initialiser for mutable */
|
|||
return strRangeCsNs(self, aString, mask, aRange);
|
||||
}
|
||||
|
||||
- (BOOL) boolValue
|
||||
{
|
||||
if (_count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else if (_count == 3
|
||||
&& (_contents_chars[0] == 'Y' || _contents_chars[0] == 'y')
|
||||
&& (_contents_chars[1] == 'E' || _contents_chars[1] == 'e')
|
||||
&& (_contents_chars[2] == 'S' || _contents_chars[2] == 's'))
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[_count+1];
|
||||
|
||||
memcpy(buf, _contents_chars, _count);
|
||||
buf[_count] = '\0';
|
||||
return atoi(buf);
|
||||
}
|
||||
}
|
||||
|
||||
- (double) doubleValue
|
||||
{
|
||||
if (_count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[_count+1];
|
||||
|
||||
memcpy(buf, _contents_chars, _count);
|
||||
buf[_count] = '\0';
|
||||
return atof(buf);
|
||||
}
|
||||
}
|
||||
|
||||
- (float) floatValue
|
||||
{
|
||||
if (_count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[_count+1];
|
||||
|
||||
memcpy(buf, _contents_chars, _count);
|
||||
buf[_count] = '\0';
|
||||
return (float) atof(buf);
|
||||
}
|
||||
}
|
||||
|
||||
- (int) intValue
|
||||
{
|
||||
if (_count == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
char buf[_count+1];
|
||||
|
||||
memcpy(buf, _contents_chars, _count);
|
||||
buf[_count] = '\0';
|
||||
return atoi(buf);
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue