#include "posix_acl.h"
#include "include/ceph_assert.h"
+#include "include/cephfs/keys_and_values.h"
#include "include/stat.h"
#include "include/cephfs/ceph_ll_client.h"
--- /dev/null
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+/*
+ * Ceph - scalable distributed file system
+ *
+ * Copyright (C) 2020 Red Hat, Inc.
+ *
+ * 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.
+ */
+
+#pragma once
+
+#include <boost/spirit/include/qi.hpp>
+
+#include <map>
+#include <string>
+
+// parse a map of keys/values.
+namespace qi = boost::spirit::qi;
+
+template <typename Iterator>
+struct keys_and_values
+ : qi::grammar<Iterator, std::map<std::string, std::string>()>
+{
+ keys_and_values()
+ : keys_and_values::base_type(query)
+ {
+ query = pair >> *(qi::lit(' ') >> pair);
+ pair = key >> '=' >> value;
+ key = qi::char_("a-zA-Z_") >> *qi::char_("a-zA-Z_0-9");
+ value = +qi::char_("a-zA-Z0-9-_.");
+ }
+ qi::rule<Iterator, std::map<std::string, std::string>()> query;
+ qi::rule<Iterator, std::pair<std::string, std::string>()> pair;
+ qi::rule<Iterator, std::string()> key, value;
+};
#include "include/types.h" // for version_t
#include "include/utime.h"
-#include <boost/spirit/include/qi.hpp>
#include "include/ceph_assert.h"
#include <boost/serialization/strong_typedef.hpp>
#include "common/ceph_json.h"
c.decode(p);
}
-// parse a map of keys/values.
-namespace qi = boost::spirit::qi;
-
-template <typename Iterator>
-struct keys_and_values
- : qi::grammar<Iterator, std::map<std::string, std::string>()>
-{
- keys_and_values()
- : keys_and_values::base_type(query)
- {
- query = pair >> *(qi::lit(' ') >> pair);
- pair = key >> '=' >> value;
- key = qi::char_("a-zA-Z_") >> *qi::char_("a-zA-Z_0-9");
- value = +qi::char_("a-zA-Z0-9-_.");
- }
- qi::rule<Iterator, std::map<std::string, std::string>()> query;
- qi::rule<Iterator, std::pair<std::string, std::string>()> pair;
- qi::rule<Iterator, std::string()> key, value;
-};
-
#endif
#include <boost/lexical_cast.hpp>
#include "include/ceph_assert.h" // lexical_cast includes system assert.h
#include "include/cephfs/metrics/Types.h"
+#include "include/cephfs/keys_and_values.h"
#include "include/random.h" // for ceph::util::generate_random_number()
#include <boost/config/warning_disable.hpp>
#include "common/Formatter.h"
#include "common/dout.h"
#include "include/ceph_assert.h"
+#include "include/cephfs/keys_and_values.h"
#define dout_subsys ceph_subsys_mon
#undef dout_prefix