Differences From Artifact [ee587b0093]:
- File src/OFJSONRepresentation.h — part of check-in [3b97fc3cd9] at 2014-01-04 00:24:08 on branch trunk — Update copyright. (user: js, size: 1127) [annotate] [blame] [check-ins using]
To Artifact [25865c5918]:
- File
src/OFJSONRepresentation.h
— part of check-in
[eaa612ad50]
at
2014-02-08 09:26:40
on branch trunk
— Add -[JSONRepresentationWithOptions:]
This also adds OF_JSON_REPRESENTATION_PRETTY. (user: js, size: 1660) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ @class OFString; /*! * @brief A protocol implemented by classes that support encoding to a JSON * representation. * * @warning Although this method can be called directly on classes other than * OFArray and OFDictionary, this will generate invalid JSON, as JSON * requires all data to be encapsulated in an array or a dictionary! */ @protocol OFJSONRepresentation /*! * @brief Returns the JSON representation of the object as a string. * | > > > > | > > > > > > > > > > > > > | 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | * Alternatively, it may be distributed under the terms of the GNU General * Public License, either version 2 or 3, which can be found in the file * LICENSE.GPLv2 or LICENSE.GPLv3 respectively included in the packaging of this * file. */ @class OFString; enum { OF_JSON_REPRESENTATION_PRETTY = 1 }; /*! * @brief A protocol implemented by classes that support encoding to a JSON * representation. * * @warning Although this method can be called directly on classes other than * OFArray and OFDictionary, this will generate invalid JSON, as JSON * requires all data to be encapsulated in an array or a dictionary! */ @protocol OFJSONRepresentation /*! * @brief Returns the JSON representation of the object as a string. * * @return The JSON representation of the object as a string */ - (OFString*)JSONRepresentation; /*! * @brief Returns the JSON representation of the object as a string. * * @param options The options to use when creating a JSON representation.@n * Possible values are: * Value | Description * --------------------------------|------------------------- * `OF_JSON_REPRESENTATION_PRETTY` | Optimize for readability * * @return The JSON representation of the object as a string */ - (OFString*)JSONRepresentationWithOptions: (int)options; @end |