Relax CHECK condition in stringAppendfImpl
[folly.git] / folly / json.h
index 5610e1cdd87573de2d387cbe82714c3fe400f020..c0a6eeb2302797072058ef1d4534e3fa5c4fc4f9 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -51,27 +51,6 @@ namespace folly {
 
 namespace json {
 
-  //////////////////////////////////////////////////////////////////////
-
-  struct ParseError : std::runtime_error {
-    explicit ParseError(int line)
-      : std::runtime_error(to<std::string>("json parse error on line ", line))
-    {}
-
-    explicit ParseError(int line, std::string const& context,
-        std::string const& expected)
-      : std::runtime_error(to<std::string>("json parse error on line ", line,
-          !context.empty() ? to<std::string>(" near `", context, '\'')
-                          : "",
-          ": ", expected))
-    {}
-
-    explicit ParseError(std::string const& msg)
-      : std::runtime_error("json parse error: " + msg)
-    {}
-  };
-
-
   struct serialization_opts {
     explicit serialization_opts()
       : allow_non_string_keys(false)
@@ -142,6 +121,11 @@ namespace json {
   void escapeString(StringPiece input,
                     fbstring& out,
                     const serialization_opts& opts);
+
+  /*
+   * Strip all C99-like comments (i.e. // and / * ... * /)
+   */
+  fbstring stripComments(StringPiece jsonC);
 }
 
 //////////////////////////////////////////////////////////////////////