diff --git a/SoObjects/SOGo/GNUmakefile b/SoObjects/SOGo/GNUmakefile index c5a1dcd05..ca032f9e8 100644 --- a/SoObjects/SOGo/GNUmakefile +++ b/SoObjects/SOGo/GNUmakefile @@ -40,6 +40,8 @@ libSOGo_HEADER_FILES = \ NSDictionary+Utilities.h \ NSObject+Utilities.h \ NSString+Utilities.h \ + NSNumber+Utilities.h \ + NSNull+Utilities.h \ NSDictionary+URL.h \ NSCalendarDate+SOGo.h \ \ @@ -68,6 +70,8 @@ libSOGo_OBJC_FILES = \ NSDictionary+Utilities.m \ NSObject+Utilities.m \ NSString+Utilities.m \ + NSNumber+Utilities.m \ + NSNull+Utilities.m \ NSCalendarDate+SOGo.m \ \ SOGoAuthenticator.m \ diff --git a/SoObjects/SOGo/NSNull+Utilities.h b/SoObjects/SOGo/NSNull+Utilities.h new file mode 100644 index 000000000..736c0cf3c --- /dev/null +++ b/SoObjects/SOGo/NSNull+Utilities.h @@ -0,0 +1,36 @@ +/* NSNull+Utilities.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef NSNUMBER_URL_H +#define NSNUMBER_URL_H + +#import + +@class NSString; + +@interface NSNull (SOGoURLExtension) + +- (NSString *) jsonRepresentation; + +@end + +#endif /* NSNUMBER_URL_H */ diff --git a/SoObjects/SOGo/NSNull+Utilities.m b/SoObjects/SOGo/NSNull+Utilities.m new file mode 100644 index 000000000..68401dbb1 --- /dev/null +++ b/SoObjects/SOGo/NSNull+Utilities.m @@ -0,0 +1,34 @@ +/* NSNull+Utilities.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse group conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import "NSNull+Utilities.h" + +@implementation NSNull (SOGoURLExtension) + +- (NSString *) jsonRepresentation +{ + return @"null"; +} + +@end diff --git a/SoObjects/SOGo/NSNumber+Utilities.h b/SoObjects/SOGo/NSNumber+Utilities.h new file mode 100644 index 000000000..d63f1e4a0 --- /dev/null +++ b/SoObjects/SOGo/NSNumber+Utilities.h @@ -0,0 +1,36 @@ +/* NSNumber+Utilities.h - this file is part of SOGo + * + * Copyright (C) 2007 Inverse groupe conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#ifndef NSNUMBER_URL_H +#define NSNUMBER_URL_H + +#import + +@class NSString; + +@interface NSNumber (SOGoURLExtension) + +- (NSString *) jsonRepresentation; + +@end + +#endif /* NSNUMBER_URL_H */ diff --git a/SoObjects/SOGo/NSNumber+Utilities.m b/SoObjects/SOGo/NSNumber+Utilities.m new file mode 100644 index 000000000..d78d36502 --- /dev/null +++ b/SoObjects/SOGo/NSNumber+Utilities.m @@ -0,0 +1,35 @@ +/* NSNumber+Utilities.m - this file is part of SOGo + * + * Copyright (C) 2007 Inverse group conseil + * + * Author: Wolfgang Sourdeau + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#import + +#import "NSNumber+Utilities.h" + +@implementation NSNumber (SOGoURLExtension) + +- (NSString *) jsonRepresentation +{ + + return [NSString stringWithFormat: @"%@", self]; +} + +@end