]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Add copyright notice, some whitespace adjustment.
authorJesse F. Williamson <jfw@ibm.com>
Fri, 7 Mar 2025 01:37:53 +0000 (17:37 -0800)
committerJesse F. Williamson <jfw@ibm.com>
Mon, 17 Mar 2025 17:41:28 +0000 (10:41 -0700)
Signed-off-by: Jesse F. Williamson <jfw@ibm.com>
src/common/ceph_json.cc
src/common/ceph_json.h

index 422bef5f15f078103661c32ce5239ea6f22d1e0f..77aceb8b3ac820a4c4588e1ced708a1c2ec0c105 100644 (file)
@@ -1,3 +1,18 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab ft=cpp
+
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2025 International Business Machines Corp.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation.  See file COPYING.
+ *
+*/
+
 #include "common/ceph_json.h"
 #include "include/utime.h"
 
@@ -43,19 +58,19 @@ ostream& operator<<(ostream &out, const JSONObj &obj) {
 void JSONObj::handle_value(boost::json::value v)
 {
   if (auto op = v.if_object()) {
-        for (const auto& kvp : *op) {
-                auto child = std::make_unique<JSONObj>(this, kvp.key(), kvp.value());
-                children.emplace(std::pair { kvp.key(), std::move(child) });
-         }
+      for (const auto& kvp : *op) {
+        auto child = std::make_unique<JSONObj>(this, kvp.key(), kvp.value());
+        children.emplace(std::pair { kvp.key(), std::move(child) });
+      }
 
-        return;
+      return;
   }
 
  if (auto ap = v.if_array()) {
-        for (const auto& kvp : *ap) {
-                auto child = std::make_unique<JSONObj>(this, "", kvp);
-                children.emplace(std::pair { child->get_name(), std::move(child) });
-         }
+      for (const auto& kvp : *ap) {
+        auto child = std::make_unique<JSONObj>(this, "", kvp);
+        children.emplace(std::pair { child->get_name(), std::move(child) });
+      }
  }
 
  // unknown type is not-an-error
@@ -69,7 +84,7 @@ vector<string> JSONObj::get_array_elements()
   return elements;
 
  std::ranges::for_each(data.as_array(), [&elements](const auto& i) {
-        elements.emplace_back(boost::json::serialize(i));
+   elements.emplace_back(boost::json::serialize(i));
  });
 
   return elements;
@@ -114,8 +129,8 @@ bool JSONParser::parse(std::string_view json_string_view)
    return true;
 
   if (data.is_string()) {
-   val.set(data.as_string(), true);
-   return true;
+    val.set(data.as_string(), true);
+    return true;
   } 
 
   // For any other kind of value:
@@ -125,7 +140,7 @@ bool JSONParser::parse(std::string_view json_string_view)
   if (s.size() == static_cast<uint64_t>(json_string_view.length())) { 
     val.set(s, false);
     return true;
-   }
+  }
 
   // Could not parse and convert:
   return false; 
index b85b3a28368b97b8cf1981afcd32bd7e2ff40c15..58416401b3f477bc23fd9fa2651f9039212a2a32 100644 (file)
@@ -1,3 +1,18 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab ft=cpp
+
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2025 International Business Machines Corp.
+ *
+ * This is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License version 2.1, as published by the Free Software
+ * Foundation.  See file COPYING.
+ *
+*/
+
 #ifndef CEPH_JSON_H
 #define CEPH_JSON_H