diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 18:24:20 +0000 |
commit | 483eb2f56657e8e7f419ab1a4fab8dce9ade8609 (patch) | |
tree | e5d88d25d870d5dedacb6bbdbe2a966086a0a5cf /src/boost/tools/bcp/fileview.hpp | |
parent | Initial commit. (diff) | |
download | ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.tar.xz ceph-483eb2f56657e8e7f419ab1a4fab8dce9ade8609.zip |
Adding upstream version 14.2.21.upstream/14.2.21upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/boost/tools/bcp/fileview.hpp')
-rw-r--r-- | src/boost/tools/bcp/fileview.hpp | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/src/boost/tools/bcp/fileview.hpp b/src/boost/tools/bcp/fileview.hpp new file mode 100644 index 00000000..fe76f84e --- /dev/null +++ b/src/boost/tools/bcp/fileview.hpp @@ -0,0 +1,72 @@ +/* + * + * Copyright (c) 2003 Dr John Maddock + * Use, modification and distribution is subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + * + */ + +#if defined(BOOST_FILESYSTEM_VERSION) && (BOOST_FILESYSTEM_VERSION != 3) +# error "This library must be built with Boost.Filesystem version 3" +#else +#define BOOST_FILESYSTEM_VERSION 3 +#endif + +#include <boost/shared_ptr.hpp> +#include <boost/filesystem/path.hpp> + +class fileview +{ +public: + // types: + typedef const char& reference; + typedef reference const_reference; + typedef const char* iterator; // See _lib.container.requirements_ + typedef iterator const_iterator; // See _lib.container.requirements_ + typedef std::size_t size_type; + typedef std::ptrdiff_t difference_type; + typedef char value_type; + typedef const char* pointer; + typedef pointer const_pointer; +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + typedef std::reverse_iterator<iterator> reverse_iterator; + typedef std::reverse_iterator<const_iterator> const_reverse_iterator; +#endif + + // construct: + fileview(); + fileview(const boost::filesystem::path& p); + ~fileview(); + fileview(const fileview& that); + fileview& operator=(const fileview& that); + void close(); + void open(const boost::filesystem::path& p); + + // iterators: + const_iterator begin() const; + const_iterator end() const; +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + const_reverse_iterator rbegin() const; + const_reverse_iterator rend() const; +#endif + + // capacity: + size_type size() const; + size_type max_size() const; + bool empty() const; + + // element access: + const_reference operator[](size_type n) const; + const_reference at(size_type n) const; + const_reference front() const; + const_reference back() const; + void swap(fileview& that); + +private: + void cow(); + struct implementation; + boost::shared_ptr<implementation> pimpl; +}; + + |