SAGA C++ API 1.6
directory.cpp
Go to the documentation of this file.
00001 #if defined(__WAVE__)
00002 #pragma wave option(preserve: 2, line: 1, output: "preprocessed/directory.cpp")
00003 #endif
00004 //  Copyright (c) 2005-2009 Hartmut Kaiser
00005 //  Copyright (c) 2005-2007 Andre Merzky (andre@merzky.net)
00006 // 
00007 //  Distributed under the Boost Software License, Version 1.0. (See accompanying 
00008 //  file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
00009 
00010 #if defined(__WAVE__)
00011 #pragma wave option(preserve: 0, output: null)
00012 #endif
00013 // include directory api and implementation
00014 #include <string>
00015 #include <vector>
00016 
00017 // include the package we implement
00018 #include <saga/saga/call.hpp>
00019 #include <saga/saga/filesystem.hpp>
00020 #include <saga/impl/filesystem.hpp>
00021 #include <saga/saga/detail/call.hpp>
00022 
00023 #ifdef SAGA_DEBUG
00024 #include <saga/saga/packages/filesystem/preprocessed/directory.cpp>
00025 #else
00026 
00027 #if defined(__WAVE__)
00028 #pragma wave option(preserve: 2, line: 1, output: "preprocessed/directory.cpp")
00029 #endif
00030 
00031 namespace saga { namespace filesystem 
00032 {
00033   directory::directory (saga::impl::directory * init)
00034     : name_space::directory (init)
00035   {
00036   }
00037 
00038   directory::directory (session const & s, saga::url url, int mode)
00039     : name_space::directory (new saga::impl::directory (s, url, mode))
00040   {
00041     this->saga::object::get_impl()->init();
00042   }
00043 
00044   directory::directory (saga::url url, int mode)
00045     : name_space::directory (new saga::impl::directory (detail::get_the_session (), url, mode))
00046   {
00047     this->saga::object::get_impl()->init();
00048   }
00049 
00050   directory::directory (saga::object const& o)
00051     : name_space::directory(o)
00052   {
00053       if (this->get_type() != saga::object::Directory)
00054       {
00055           SAGA_THROW("Bad type conversion.", saga::BadParameter);
00056       }
00057   }
00058 
00059   directory::directory (void)
00060   {
00061   }
00062 
00063   directory::~directory (void)
00064   {
00065   }
00066 
00067   directory &directory::operator= (saga::object const& o)
00068   {
00069       return this->saga::name_space::directory::operator=(o), *this;
00070   }
00071 
00072   saga::impl::directory* directory::get_impl() const
00073   { 
00074     typedef saga::object base_type;
00075     return static_cast<saga::impl::directory*>(this->base_type::get_impl()); 
00076   }
00077 
00078   TR1::shared_ptr <saga::impl::directory> directory::get_impl_sp() const
00079   { 
00080     typedef saga::object base_type;
00081     return TR1::static_pointer_cast<saga::impl::directory>(
00082         this->base_type::get_impl_sp()); 
00083   }
00084 
00085   // factory
00086   SAGA_CALL_CREATE_IMP_3(directory, impl::directory, session const&, saga::url, int)
00087 
00088   // get file info
00089   SAGA_CALL_IMP_2 (directory, get_size, saga::url, int)
00090   SAGA_CALL_IMP_1 (directory, is_file,  saga::url)
00091 
00092   // overload open methods from namespace_dir
00093   SAGA_CALL_IMP_2 (directory, open, saga::url, int)
00094   SAGA_CALL_IMP_2 (directory, open_dir, saga::url, int)
00095 
00097 }} // namespace saga
00098 
00099 #endif
00100 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines