IJsonWrapper.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #region Header
  2. /**
  3. * IJsonWrapper.cs
  4. * Interface that represents a type capable of handling all kinds of JSON
  5. * data. This is mainly used when mapping objects through JsonMapper, and
  6. * it's implemented by JsonData.
  7. *
  8. * The authors disclaim copyright to this source code. For more details, see
  9. * the COPYING file included with this distribution.
  10. **/
  11. #endregion
  12. using System.Collections;
  13. using System.Collections.Specialized;
  14. namespace LitJson
  15. {
  16. public enum JsonType
  17. {
  18. None,
  19. Object,
  20. Array,
  21. String,
  22. Int,
  23. Long,
  24. Double,
  25. Boolean
  26. }
  27. public interface IJsonWrapper : IList, IOrderedDictionary
  28. {
  29. bool IsArray { get; }
  30. bool IsBoolean { get; }
  31. bool IsDouble { get; }
  32. bool IsInt { get; }
  33. bool IsLong { get; }
  34. bool IsObject { get; }
  35. bool IsString { get; }
  36. bool GetBoolean ();
  37. double GetDouble ();
  38. int GetInt ();
  39. JsonType GetJsonType ();
  40. long GetLong ();
  41. string GetString ();
  42. void SetBoolean (bool val);
  43. void SetDouble (double val);
  44. void SetInt (int val);
  45. void SetJsonType (JsonType type);
  46. void SetLong (long val);
  47. void SetString (string val);
  48. string ToJson ();
  49. void ToJson (JsonWriter writer);
  50. }
  51. }