Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# BinaryReader.h

Go to the documentation of this file.

    00001 //------------------------------------------------------------------------------
    00002 // Lamp : Open source game middleware
    00003 // Copyright (C) 2004  Junpei Ohtani ( Email : junpee@users.sourceforge.jp )
    00004 //
    00005 // This library is free software; you can redistribute it and/or
    00006 // modify it under the terms of the GNU Lesser General Public
    00007 // License as published by the Free Software Foundation; either
    00008 // version 2.1 of the License, or (at your option) any later version.
    00009 //
    00010 // This library is distributed in the hope that it will be useful,
    00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
    00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00013 // Lesser General Public License for more details.
    00014 //
    00015 // You should have received a copy of the GNU Lesser General Public
    00016 // License along with this library; if not, write to the Free Software
    00017 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
    00018 //------------------------------------------------------------------------------
    00019
    00020 /** @file
    00021  * バイナリリーダヘッダ
    00022  * @author Junpee
    00023  */
    00024
    00025 #ifndef BINARY_READER_H_
    00026 #define BINARY_READER_H_
    00027
    00028 #include <Core/InputOutput/Reader.h>
    00029
    00030 namespace Lamp{
    00031
    00032 //------------------------------------------------------------------------------
    00033 /**
    00034  * バイナリリーダ
    00035  */
    00036 class BinaryReader : public Reader{
    00037 public:
    00038     /**
    00039      * デストラクタ
    00040      */
    00041     virtual ~BinaryReader();
    00042
    00043     /**
    00044      * バイナリリーダの複製
    00045      * @return 複製されたバイナリリーダ
    00046      */
    00047     virtual BinaryReader* cloneBinaryReader() = 0;
    00048
    00049     /**
    00050      * リーダの複製
    00051      * @return 複製されたリーダ
    00052      */
    00053     virtual Reader* cloneReader(){ return cloneBinaryReader(); }
    00054
    00055     /**
    00056      * boolの読み込み
    00057      * @return 読み込んだ値
    00058      */
    00059     virtual bool readBool();
    00060
    00061     /**
    00062      * charの読み込み
    00063      * @return 読み込んだ値
    00064      */
    00065     virtual char readChar();
    00066
    00067     /**
    00068      * u_charの読み込み
    00069      * @return 読み込んだ値
    00070      */
    00071     virtual u_char readUChar();
    00072
    00073     /**
    00074      * shortの読み込み
    00075      * @return 読み込んだ値
    00076      */
    00077     virtual short readShort();
    00078
    00079     /**
    00080      * u_shortの読み込み
    00081      * @return 読み込んだ値
    00082      */
    00083     virtual u_short readUShort();
    00084
    00085     /**
    00086      * intの読み込み
    00087      * @return 読み込んだ値
    00088      */
    00089     virtual int readInt();
    00090
    00091     /**
    00092      * u_intの読み込み
    00093      * @return 読み込んだ値
    00094      */
    00095     virtual u_int readUInt();
    00096
    00097     /**
    00098      * floatの読み込み
    00099      * @return 読み込んだ値
    00100      */
    00101     virtual float readFloat();
    00102
    00103     /**
    00104      * doubleの読み込み
    00105      * @return 読み込んだ値
    00106      */
    00107     virtual double readDouble();
    00108
    00109     /**
    00110      * Stringの読み込み
    00111      * @return 読み込んだ文字列
    00112      */
    00113     virtual const String readString();
    00114
    00115     /**
    00116      * 配列の読み込み
    00117      * @param array 読み込み先配列
    00118      * @param elementSize 要素のサイズ
    00119      * @param elementCount 要素の数
    00120      */
    00121     virtual void readArray(
    00122         void* array, int elementSize, int elementCount);
    00123
    00124 protected:
    00125     /**
    00126      * コンストラクタ
    00127      */
    00128     BinaryReader();
    00129
    00130 private:
    00131
    00132 };
    00133
    00134 //------------------------------------------------------------------------------
    00135 } // End of namespace Lamp
    00136 #endif // End of BINARY_READER_H_
    00137 //------------------------------------------------------------------------------