#if defined(__WAVE__) #pragma wave option(preserve: 2, line: 0, output: "preprocessed/file.cpp") #endif // Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net) // Copyright (c) 2005-2007 Hartmut Kaiser (hartmut.kaiser@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(preserve: 0, output: null) #endif #include #include #include #include #include #ifdef SAGA_DEBUG #include #else #if defined(__WAVE__) #pragma wave option(preserve: 2, output: "preprocessed/file.cpp") #endif /////////////////////////////////////////////////////////////////////////////// namespace saga { namespace impl { file::file (saga::session const & s, std::string const & url, int mode, saga::off_t pointer) : namespace_entry (saga::object::File, s) { // initialize the instance data typedef adaptors::v1_0::file_cpi_instance_data instance_data_type; typedef adaptors::instance_data file_instance_data; // make sure url is valid saga::url file_url(url); { file_instance_data data; data.init_data (this, TR1::shared_ptr ( new instance_data_type (file_url.get_url(), mode, pointer))); } // lock goes out of scope } void file::init() { // initialize a CPI instance and execute required functions (such as // creating the file etc.) this->initcpi(saga::adaptors::file_cpi); } file::~file (void) { // free the instance data typedef adaptors::v1_0::file_cpi_instance_data instance_data_type; typedef adaptors::instance_data file_instance_data; file_instance_data data; data.release_data (this); } // API methods not covered by namespace_entry SAGA_CALL_IMPL_IMPL_0 (file, file_cpi, saga::off_t, get_size) SAGA_CALL_IMPL_IMPL_1 (file, file_cpi, saga::ssize_t, read, mutable_buffer) SAGA_CALL_IMPL_IMPL_1 (file, file_cpi, saga::ssize_t, write, const_buffer) SAGA_CALL_IMPL_IMPL_2 (file, file_cpi, saga::off_t, seek, saga::off_t, saga::file::seek_mode) } // namespace impl } // namespace saga /////////////////////////////////////////////////////////////////////////////// #endif