bstring_buf.hpp

См. документацию.
00001 /*
00002 
00003 Copyright (c) 2002-2005, Yauheni Akhotnikau
00004 All rights reserved.
00005 
00006 Redistribution and use in source and binary forms, with or without
00007 modification, are permitted provided that the following conditions are met:
00008 
00009 - Redistributions of source code must retain the above copyright notice, this
00010 list of conditions and the following disclaimer.
00011 
00012 - Redistributions in binary form must reproduce the above copyright notice, this
00013 list of conditions and the following disclaimer in the documentation and/or
00014 other materials provided with the distribution.
00015 
00016 - The name of the author may not be used to endorse or promote products derived
00017 from this software without specific prior written permission.
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
00020 WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
00021 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
00022 EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00023 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
00024 OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00025 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00026 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
00027 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
00028 OF SUCH DAMAGE.
00029 
00030 */
00031 
00037 #if !defined( _OESS_1__IO__BSTRING_BUF_HPP_ )
00038 #define _OESS_1__IO__BSTRING_BUF_HPP_
00039 
00040 #include <oess_1/io/h/declspec.hpp>
00041 
00042 #include <auto_ptr_3/h/vect_ptr.hpp>
00043 
00044 #include <oess_1/io/h/binbuffer.hpp>
00045 
00046 namespace oess_1 {
00047 
00048 namespace io {
00049 
00050 //
00051 // ibstring_t
00052 //
00053 
00055 
00077 class OESS_1__IO__TYPE  ibstring_t :
00078   public ibinbuffer_t
00079 {
00080   public :
00081     ibstring_t(
00084 
00089       const std::string & from );
00090     virtual ~ibstring_t();
00091 
00093 
00096     size_t
00097     capacity() const;
00098 
00100 
00102     virtual size_t
00103     size() const;
00104 
00107     virtual size_t
00108     pos() const;
00109 
00112 
00116     void
00117     set_pos( size_t pos );
00118 
00120 
00124     virtual bool
00125     eof() const;
00126 
00127   protected :
00129 
00134     virtual const oess_1::char_t *
00135     in_reserve(
00138       size_t item_count,
00140       size_t item_size,
00143       size_t & item_available );
00144 
00146     virtual void
00147     in_shift(
00149       size_t item_count,
00151       size_t item_size );
00152 
00153   private :
00155     const std::string & m_from;
00157     size_t  m_pos;
00158 
00159   private :
00161     ibstring_t(
00162       const ibstring_t & );
00164     ibstring_t &
00165     operator=(
00166       const ibstring_t & );
00167 };
00168 
00169 //
00170 // obstring_t
00171 //
00172 
00174 
00196 class OESS_1__IO__TYPE  obstring_t :
00197   public obinbuffer_t
00198 {
00199   public :
00200     obstring_t(
00203 
00208       std::string & to );
00209     virtual ~obstring_t();
00210 
00212 
00215     size_t
00216     len() const;
00217 
00219 
00222     virtual size_t
00223     capacity() const;
00224 
00226 
00229     virtual size_t
00230     size() const;
00231 
00233 
00238     virtual size_t
00239     pos() const;
00240 
00241   protected :
00243     virtual oess_1::char_t *
00244     out_reserve(
00247       size_t item_count,
00249       size_t item_size,
00252       size_t & item_available );
00253 
00255     virtual void
00256     out_shift(
00258       size_t item_count,
00260       size_t item_size );
00261 
00262   private :
00264     std::string & m_to;
00265 
00268     auto_ptr_3::vect_ptr_t< oess_1::char_t >  m_buf;
00269 
00270   private :
00272     obstring_t(
00273       const obstring_t & );
00275     obstring_t &
00276     operator=(
00277       const obstring_t & );
00278 };
00279 
00280 } /* namespace io */
00281 
00282 } /* namespace oess_1 */
00283 
00284 #endif

Документация по ObjESSty. Последние изменения: Fri Oct 13 18:35:36 2006. Создано системой  doxygen 1.4.7
Hosted by uCoz