Added folly::hint_emplace_iterator to folly/Iterator.h
[folly.git] / folly / json.h
index 158352471f264682c858ca717a71df04985e9fdb..788587a8aa6defbabf2b8ef69b91f07f5ceee278 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -43,8 +43,9 @@
 #include <iosfwd>
 #include <string>
 
-#include <folly/dynamic.h>
+#include <folly/Function.h>
 #include <folly/Range.h>
+#include <folly/dynamic.h>
 
 namespace folly {
 
@@ -95,8 +96,14 @@ namespace json {
     bool allow_trailing_comma;
 
     // Sort keys of all objects before printing out (potentially slow)
+    // using dynamic::operator<.
+    // Has no effect if sort_keys_by is set.
     bool sort_keys;
 
+    // Sort keys of all objects before printing out (potentially slow)
+    // using the provided less functor.
+    Function<bool(dynamic const&, dynamic const&) const> sort_keys_by;
+
     // Replace invalid utf8 characters with U+FFFD and continue
     bool skip_invalid_utf8;