From 1d055261b4144dbf86b2658437015b15d4dd9bff Mon Sep 17 00:00:00 2001 From: Richard Date: Sun, 4 Sep 2022 00:32:56 +0100 Subject: initial --- include/jsoncons/ser_context.hpp | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 include/jsoncons/ser_context.hpp (limited to 'include/jsoncons/ser_context.hpp') diff --git a/include/jsoncons/ser_context.hpp b/include/jsoncons/ser_context.hpp new file mode 100644 index 0000000..f5b9d14 --- /dev/null +++ b/include/jsoncons/ser_context.hpp @@ -0,0 +1,57 @@ +/// Copyright 2013-2018 Daniel Parker +// Distributed under the Boost license, Version 1.0. +// (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See https://github.com/danielaparker/jsoncons for latest version + +#ifndef JSONCONS_SER_CONTEXT_HPP +#define JSONCONS_SER_CONTEXT_HPP + +namespace jsoncons { + +class ser_context +{ +public: + virtual ~ser_context() noexcept = default; + + virtual size_t line() const + { + return 0; + } + + virtual size_t column() const + { + return 0; + } + + virtual size_t position() const + { + return 0; + } + +#if !defined(JSONCONS_NO_DEPRECATED) + JSONCONS_DEPRECATED_MSG("Instead, use line()") + std::size_t line_number() const + { + return line(); + } + + JSONCONS_DEPRECATED_MSG("Instead, use column()") + std::size_t column_number() const + { + return column(); + } +#endif +}; + +#if !defined(JSONCONS_NO_DEPRECATED) +JSONCONS_DEPRECATED_MSG("Instead, use ser_context") typedef ser_context null_ser_context; + +JSONCONS_DEPRECATED_MSG("Instead, use ser_context") typedef ser_context parsing_context; +JSONCONS_DEPRECATED_MSG("Instead, use ser_context") typedef ser_context serializing_context; +JSONCONS_DEPRECATED_MSG("Instead, use ser_context") typedef ser_context null_parsing_context; +JSONCONS_DEPRECATED_MSG("Instead, use ser_context") typedef ser_context null_serializing_context; +#endif + +} +#endif -- cgit v1.2.3