FDO .NET API Reference Feature Data Objects

mgIoCharStreamReader.h

Go to the documentation of this file.
00001 /*
00002 * Copyright (C) 2004-2006  Autodesk, Inc.
00003 * 
00004 * This library is free software; you can redistribute it and/or
00005 * modify it under the terms of version 2.1 of the GNU Lesser
00006 * General Public License as published by the Free Software Foundation.
00007 * 
00008 * This library is distributed in the hope that it will be useful,
00009 * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 * Lesser General Public License for more details.
00012 * 
00013 * You should have received a copy of the GNU Lesser General Public
00014 * License along with this library; if not, write to the Free Software
00015 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00016 *
00017 */
00018 
00019 #pragma once
00020 
00021 #include "Common\mgIStreamReaderImp.h"
00022 
00023 template <typename T>
00024 class FdoIStreamReaderTmpl;
00025 
00026 BEGIN_NAMESPACE_OSGEO_COMMON_IO
00027 public __gc class IoStream;
00028 
00029 /// \ingroup (OSGeoFDOCommonIo)
00030 /// \brief
00031 ///     IoCharStreamReader reads items from a stream of chars.
00032 public __sealed __gc class IoCharStreamReader : public NAMESPACE_OSGEO_COMMON::IStreamReaderImp
00033 {
00034 public:
00035     /// \brief
00036     ///     Skips a number of items
00037     /// 
00038     /// \param offset 
00039     ///     Input number of items to skip
00040     /// 
00041     System::Void Skip(System::Int32 offset);
00042 
00043     /// \brief
00044     ///     Reset the current index to the stream start. Allows re-reading.
00045     /// 
00046     System::Void Reset();  
00047 
00048     /// \brief
00049     ///     Reads in the next block of items. The caller is responsible to allocate a buffer large 
00050     ///     enough to store data.
00051     /// 
00052     /// \param buffer 
00053     ///     Output array holding data read in.
00054     ///
00055     /// \return
00056     ///     Returns the number of items actually read in. When 0 (zero) then the 
00057     ///     end-of-stream was reached.
00058     /// 
00059     System::Int32 ReadNext(System::Char buffer[]);
00060 
00061     /// \brief
00062     ///     Reads in the next block of items. Use ReadNext( buffer) to read in 
00063     ///     the entire stream. The caller is responsible to allocate a buffer large 
00064     ///     enough to store data.
00065     /// 
00066     /// \param buffer 
00067     ///     Output array holding data read in.
00068     ///
00069     /// \param offset 
00070     ///     Input index in the array indicating the beginning of the output buffer. 
00071     ///     If zero, then the buffer is reused. If the end of the buffer, then read in 
00072     ///     appending mode. Throws "out-of-bounds" exception if not in this range.
00073     ///
00074     /// \return
00075     ///     Returns the number of items actually read in. When 0 (zero) then the 
00076     ///     end-of-stream was reached.
00077     /// 
00078     System::Int32 ReadNext(System::Char buffer[], System::Int32 offset);
00079 
00080     /// \brief
00081     ///     Reads in the next block of items. Use ReadNext( buffer) to read in 
00082     ///     the entire stream. The caller is responsible to allocate a buffer large 
00083     ///     enough to store data.
00084     /// 
00085     /// \param buffer 
00086     ///     Output array holding data read in.
00087     ///
00088     /// \param offset 
00089     ///     Input index in the array indicating the beginning of the output buffer. 
00090     ///     If zero, then the buffer is reused. If the end of the buffer, then read in 
00091     ///     appending mode. Throws "out-of-bounds" exception if not in this range.
00092     ///
00093     /// \param count 
00094     ///     Input number of items to be read in. If -1 read the entire stream.
00095     ///     Throws "out-of-bounds"  exception if not a positive value or -1.
00096     /// 
00097     /// \return
00098     ///     Returns the number of items actually read in. When 0 (zero) then the 
00099     ///     end-of-stream was reached.
00100     /// 
00101     System::Int32 ReadNext(System::Char buffer[], System::Int32 offset, System::Int32 count);
00102 
00103     /// \brief
00104     ///     Gets the stream length
00105     /// 
00106     /// \return
00107     ///     Returns the size of the data source in number of items 
00108     /// 
00109     __property System::Int64 get_Length();
00110 
00111     /// \brief
00112     ///     Gets the current stream position. Position is 
00113     ///     measured by number of items from the stream start
00114     /// 
00115     /// \return
00116     ///     Returns the current index in the stream
00117     /// 
00118     __property System::Int64 get_Index();
00119 
00120     /// \brief
00121     ///     Constructs a stream reader based on an unmanaged instance of the object
00122     /// 
00123     /// \param unmanaged 
00124     ///     Input A Pointer to the unmanaged stream reader.
00125     /// 
00126     /// \param autoDelete 
00127     ///     Input Indicates if the constructed object should be automatically deleted 
00128     ///     once it no longer referenced.
00129     /// 
00130     IoCharStreamReader(System::IntPtr unmanaged, System::Boolean autoDelete);
00131 
00132 /// \cond DOXYGEN-IGNORE
00133 public private:
00134     inline FdoIStreamReaderTmpl<FdoCharacter>* GetImpObj();
00135 /// \endcond
00136 };
00137 
00138 END_NAMESPACE_OSGEO_COMMON_IO
00139 
00140 

Comments or suggestions? Send us feedback.