#ifndef SAGA_IMPL_PACKAGES_DATA_FILE_FILE_HPP #define SAGA_IMPL_PACKAGES_DATA_FILE_FILE_HPP #if defined(__WAVE__) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/file.hpp") #endif // Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) // Copyright (c) 2005-2007 Hartmut Kaiser (hartmut.kaiser@gmail.com) // Copyright (c) 2005 Michel Zandstra [michelzandstra@gmail.com] // // Distributed under 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(__WAVE__) #pragma wave option(output: null) #endif #if defined(_MSC_VER) && (_MSC_VER >= 1200) #pragma once #endif #include #include #include #include #include #include #include #include #include #ifdef SAGA_DEBUG #include #else #if defined(__WAVE__) #pragma wave option(output: "preprocessed/file.hpp") #endif /////////////////////////////////////////////////////////////////////////////// namespace saga { namespace impl { /** * This class acts as a proxy class, hiding all the nasty Saga stuff * (like creating and using adaptors) for the user. Users just call * the functions of this class like to would on every local object, * and don't have to worry about adaptors. It extends saga::file_cpi. */ class file : public saga::impl::namespace_entry, public saga::impl::attribute { typedef v1_0::file_cpi file_cpi; typedef v1_0::preference_type preference_type; // initialize newly attached CPI instance void init(); public: /** * Constructor of file, sets the location of the file, and gets * an instance of the Saga engine * * @param url the full path and name of the file * @param s the session handle */ file (saga::session const & s, std::string const & url, int mode, saga::off_t pointer = 0); /*! destructor of file, destroys file and the adaptor it is * bound to */ ~file (void); // API functions not covered by namespace_entry SAGA_CALL_IMPL_DECL_0 (saga::off_t, get_size); SAGA_CALL_IMPL_DECL_1 (saga::ssize_t, read, mutable_buffer); SAGA_CALL_IMPL_DECL_1 (saga::ssize_t, write, const_buffer); SAGA_CALL_IMPL_DECL_2 (saga::off_t, seek, saga::off_t, saga::file::seek_mode); /////////////////////////////////////////////////////////////////////// // return the attribute interface to the facade saga::impl::attribute* get_attributes() { return this; } saga::impl::attribute const* get_attributes() const { return this; } }; } // namespace impl } // namespace saga /////////////////////////////////////////////////////////////////////////////// #if defined(__WAVE__) #pragma wave option(output: null) #endif #endif // !defined(SAGA_DEBUG) #endif // SAGA_IMPL_PACKAGES_DATA_FILE_FILE_HPP