~ubuntu-branches/ubuntu/karmic/gnustep-base/karmic

« back to all changes in this revision

Viewing changes to Source/GSValue.m

  • Committer: Bazaar Package Importer
  • Author(s): Eric Heintzmann
  • Date: 2005-04-17 00:14:38 UTC
  • mfrom: (1.2.1 upstream) (2.1.2 hoary)
  • Revision ID: james.westby@ubuntu.com-20050417001438-enf0y07c9tku85z1
Tags: 1.10.3-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
   modify it under the terms of the GNU Library General Public
11
11
   License as published by the Free Software Foundation; either
12
12
   version 2 of the License, or (at your option) any later version.
13
 
   
 
13
 
14
14
   This library is distributed in the hope that it will be useful,
15
15
   but WITHOUT ANY WARRANTY; without even the implied warranty of
16
16
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21
21
   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
22
22
*/
23
23
 
24
 
#include <config.h>
25
 
#include <Foundation/NSValue.h>
26
 
#include <Foundation/NSString.h>
27
 
#include <Foundation/NSData.h>
28
 
#include <Foundation/NSException.h>
29
 
#include <Foundation/NSCoder.h>
30
 
#include <Foundation/NSZone.h>
31
 
#include <Foundation/NSObjCRuntime.h>
32
 
#include <base/preface.h>
 
24
#include "config.h"
 
25
#include "Foundation/NSValue.h"
 
26
#include "Foundation/NSString.h"
 
27
#include "Foundation/NSData.h"
 
28
#include "Foundation/NSException.h"
 
29
#include "Foundation/NSCoder.h"
 
30
#include "Foundation/NSZone.h"
 
31
#include "Foundation/NSObjCRuntime.h"
 
32
#include "GNUstepBase/preface.h"
33
33
 
34
34
@interface GSValue : NSValue
35
35
{
75
75
    }
76
76
}
77
77
 
78
 
// Allocating and Initializing 
 
78
// Allocating and Initializing
79
79
 
80
80
- (id) initWithBytes: (const void *)value
81
81
            objCType: (const char *)type
82
82
{
83
 
  if (!value || !type) 
 
83
  if (!value || !type)
84
84
    {
85
85
      NSLog(@"Tried to create NSValue with NULL value or NULL type");
86
86
      RELEASE(self);
91
91
  if (self != nil)
92
92
    {
93
93
      int       size = typeSize(type);
94
 
  
95
 
      if (size < 0) 
 
94
 
 
95
      if (size < 0)
96
96
        {
97
97
          NSLog(@"Tried to create NSValue with invalid Objective-C type");
98
98
          RELEASE(self);
118
118
  [super dealloc];
119
119
}
120
120
 
121
 
// Accessing Data 
 
121
// Accessing Data
122
122
- (void) getValue: (void *)value
123
123
{
124
124
  unsigned      size;
170
170
{
171
171
  return objctype;
172
172
}
173
 
 
 
173
 
174
174
- (id) nonretainedObjectValue
175
175
{
176
176
  unsigned      size = (unsigned)typeSize(objctype);
182
182
    }
183
183
  return *((id *)data);
184
184
}
185
 
 
 
185
 
186
186
- (NSPoint) pointValue
187
187
{
188
188
  unsigned      size = (unsigned)typeSize(objctype);
218
218
    }
219
219
  return *((NSRect *)data);
220
220
}
221
 
 
 
221
 
222
222
- (NSSize) sizeValue
223
223
{
224
224
  unsigned      size = (unsigned)typeSize(objctype);
230
230
    }
231
231
  return *((NSSize *)data);
232
232
}
233
 
 
 
233
 
234
234
- (NSString *) description
235
235
{
236
236
  unsigned      size;