JsonOptions.cs 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // JsonKit v0.5 - A simple but flexible Json library in a single .cs file.
  2. //
  3. // Copyright (C) 2014 Topten Software (contact@toptensoftware.com) All rights reserved.
  4. //
  5. // Licensed under the Apache License, Version 2.0 (the "License"); you may not use this product
  6. // except in compliance with the License. You may obtain a copy of the License at
  7. //
  8. // http://www.apache.org/licenses/LICENSE-2.0
  9. //
  10. // Unless required by applicable law or agreed to in writing, software distributed under the
  11. // License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  12. // either express or implied. See the License for the specific language governing permissions
  13. // and limitations under the License.
  14. using System;
  15. namespace Topten.JsonKit
  16. {
  17. /// <summary>
  18. /// Options to controls formatting/parsing and write behaviour
  19. /// </summary>
  20. [Flags]
  21. public enum JsonOptions
  22. {
  23. /// <summary>
  24. /// No special options
  25. /// </summary>
  26. None = 0,
  27. /// <summary>
  28. /// Force writing of whitespace (pretty print)
  29. /// </summary>
  30. WriteWhitespace = 0x00000001,
  31. /// <summary>
  32. /// Disable writing of whitespace
  33. /// </summary>
  34. DontWriteWhitespace = 0x00000002,
  35. /// <summary>
  36. /// Enforce strict parsing (comments, array commas etc..)
  37. /// </summary>
  38. StrictParser = 0x00000004,
  39. /// <summary>
  40. /// Relax some parsing rules
  41. /// </summary>
  42. NonStrictParser = 0x00000008,
  43. /// <summary>
  44. /// Flush the textwriter stream when finished writing
  45. /// </summary>
  46. Flush = 0x00000010,
  47. /// <summary>
  48. /// Use the Json.SavePreviousVersion property to control saving previous versions
  49. /// </summary>
  50. AutoSavePreviousVersion = 0x00000020,
  51. /// <summary>
  52. /// Always save a previous version
  53. /// </summary>
  54. SavePreviousVersion = 0x00000040,
  55. }
  56. }