PageRenderTime 70ms CodeModel.GetById 20ms RepoModel.GetById 4ms app.codeStats 0ms

/jni w: itoa runtime and allocator/Foundation/NSMutableString.m

https://github.com/Akheon23/FrozenCocoa-POC
Objective C | 96 lines | 52 code | 17 blank | 27 comment | 2 complexity | 03a361bebfaa2a1bf0420ed6d459412f MD5 | raw file
Possible License(s): MPL-2.0
  1. /*
  2. * Copyright (c) 2011 Dmitry Skiba
  3. *
  4. * Permission is hereby granted, free of charge, to any person
  5. * obtaining a copy of this software and associated documentation
  6. * files (the "Software"), to deal in the Software without
  7. * restriction, including without limitation the rights to use,
  8. * copy, modify, merge, publish, distribute, sublicense, and/or sell
  9. * copies of the Software, and to permit persons to whom the
  10. * Software is furnished to do so, subject to the following
  11. * conditions:
  12. *
  13. * The above copyright notice and this permission notice shall be
  14. * included in all copies or substantial portions of the Software.
  15. *
  16. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  17. * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
  18. * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
  19. * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
  20. * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
  21. * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  22. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  23. * OTHER DEALINGS IN THE SOFTWARE.
  24. */
  25. #include <string.h>
  26. #import <Foundation/NSString.h>
  27. #import "NSCFMutableString.h"
  28. #import "NSInternal.h"
  29. /*
  30. * NSMutableString
  31. */
  32. @implementation NSMutableString
  33. +(id)stringWithCapacity:(NSUInteger)capacity {
  34. return [[[self alloc] initWithCapacity:capacity] autorelease];
  35. }
  36. -(id)initWithCapacity:(NSUInteger)capacity {
  37. NS_ABSTRACT_METHOD_BODY;
  38. }
  39. +(id)allocWithZone:(NSZone*)zone {
  40. if (self == [NSMutableString class]) {
  41. return [NSMutableString_placeholder allocWithZone:zone];
  42. }
  43. return [super allocWithZone:zone];
  44. }
  45. -(id)copy {
  46. return [[NSString alloc] initWithString:self];
  47. }
  48. -(id)copyWithZone:(NSZone*)zone {
  49. return [[NSString allocWithZone:zone] initWithString:self];
  50. }
  51. -(Class)classForCoder {
  52. return [NSMutableString class];
  53. }
  54. -(void)appendString:(NSString*)string {
  55. NS_ABSTRACT_METHOD_BODY;
  56. }
  57. -(void)appendFormat:(NSString*)format, ...{
  58. NS_ABSTRACT_METHOD_BODY;
  59. }
  60. -(void)deleteCharactersInRange:(NSRange)range {
  61. NS_ABSTRACT_METHOD_BODY;
  62. }
  63. -(void)replaceCharactersInRange:(NSRange)range withString:(NSString*)string {
  64. NS_ABSTRACT_METHOD_BODY;
  65. }
  66. -(void)insertString:(NSString*)string atIndex:(NSUInteger)index {
  67. NS_ABSTRACT_METHOD_BODY;
  68. }
  69. -(void)setString:(NSString*)string {
  70. NS_ABSTRACT_METHOD_BODY;
  71. }
  72. -(NSUInteger)replaceOccurrencesOfString:(NSString*)target
  73. withString:(NSString*)replacement
  74. options:(NSStringCompareOptions)options
  75. range:(NSRange)searchRange
  76. {
  77. NS_ABSTRACT_METHOD_BODY;
  78. }
  79. @end