Show
Ignore:
Timestamp:
03/21/12 18:36:20 (2 years ago)
Author:
robert
Message:

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/osga/OSGA_Archive.h

    r12638 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 Robert Osfield 
    22 * 
    3  * This library is open source and may be redistributed and/or modified under   
    4  * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or  
     3 * This library is open source and may be redistributed and/or modified under 
     4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 
    55 * (at your option) any later version.  The full license is in LICENSE file 
    66 * included with this distribution, and on the openscenegraph.org website. 
    7  *  
     7 * 
    88 * This library is distributed in the hope that it will be useful, 
    99 * but WITHOUT ANY WARRANTY; without even the implied warranty of 
    10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  
     10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
    1111 * OpenSceneGraph Public License for more details. 
    1212*/ 
     
    1919#include <OpenThreads/ReentrantMutex> 
    2020 
    21 #define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex)   
     21#define SERIALIZER() OpenThreads::ScopedLock<OpenThreads::ReentrantMutex> lock(_serializerMutex) 
    2222 
    2323class OSGA_Archive : public osgDB::Archive 
     
    2525    public: 
    2626        OSGA_Archive(); 
    27         virtual ~OSGA_Archive();  
     27        virtual ~OSGA_Archive(); 
    2828 
    2929        virtual const char* libraryName() const { return "osga"; } 
     
    3535            return osgDB::equalCaseInsensitive(extension,"osga"); 
    3636        } 
    37          
     37 
    3838        /** open the archive.*/ 
    3939        virtual bool open(const std::string& filename, ArchiveStatus status, unsigned int indexBlockSizeHint=4096); 
     
    4747        /** Get the file name which represents the archived file.*/ 
    4848        virtual std::string getArchiveFileName() const { return _archiveFileName; } 
    49          
     49 
    5050        /** Get the file name which represents the master file recorded in the Archive.*/ 
    5151        virtual std::string getMasterFileName() const; 
    52          
     52 
    5353        /** return true if file exists in archive.*/ 
    5454        virtual bool fileExists(const std::string& filename) const; 
     
    9090        /** Write an osg::Shader with specified file name to the Archive.*/ 
    9191        virtual WriteResult writeShader(const osg::Shader& shader,const std::string& fileName,const Options* options=NULL) const; 
    92          
     92 
    9393        #if defined(_MSC_VER) 
    9494        typedef __int64 pos_type; 
     
    9898        typedef unsigned long long size_type; 
    9999        #endif 
    100          
     100 
    101101        typedef std::pair<pos_type, size_type> PositionSizePair; 
    102102        typedef std::map<std::string, PositionSizePair> FileNamePositionMap; 
    103          
     103 
    104104    protected: 
    105    
     105 
    106106        mutable OpenThreads::ReentrantMutex _serializerMutex; 
    107107 
     
    113113        public: 
    114114            IndexBlock(unsigned int blockSize=0); 
    115              
     115 
    116116            inline pos_type getPosition() const { return _filePosition; } 
    117117 
     
    120120 
    121121            void setPositionNextIndexBlock(pos_type position); 
    122              
     122 
    123123            inline pos_type getPositionNextIndexBlock() const { return _filePositionNextIndexBlock; } 
    124124 
    125125 
    126126            static IndexBlock* read(std::istream& in, bool doEndianSwap); 
    127              
     127 
    128128            std::string getFirstFileName() const; 
    129129 
    130130            bool getFileReferences(FileNamePositionMap& indexMap) const; 
    131              
     131 
    132132 
    133133            inline bool requiresWrite() const { return _requiresWrite; } 
    134              
     134 
    135135            void write(std::ostream& out); 
    136              
     136 
    137137            inline bool spaceAvailable(pos_type, size_type, const std::string& filename) const 
    138138            { 
     
    140140                return (_offsetOfNextAvailableSpace + requiredSize)<_blockSize; 
    141141            } 
    142              
     142 
    143143            bool addFileReference(pos_type position, size_type size, const std::string& filename); 
    144              
     144 
    145145 
    146146 
    147147        protected: 
    148              
     148 
    149149            void allocateData(unsigned int blockSize); 
    150          
     150 
    151151            virtual ~IndexBlock(); 
    152152            bool            _requiresWrite; 
     
    158158            char*           _data; 
    159159        }; 
    160      
    161     public:  
     160 
     161    public: 
    162162        /** Functor used in internal implementations.*/ 
    163163        struct ReadFunctor 
     
    187187            const osgDB::ReaderWriter::Options* _options; 
    188188        }; 
    189          
     189 
    190190    protected: 
    191191        struct ReadObjectFunctor; 
     
    205205        osgDB::ReaderWriter::ReadResult read(const ReadFunctor& readFunctor); 
    206206        osgDB::ReaderWriter::WriteResult write(const WriteFunctor& writeFunctor); 
    207      
     207 
    208208        typedef std::list< osg::ref_ptr<IndexBlock> >   IndexBlockList; 
    209          
     209 
    210210        bool _open(std::istream& fin); 
    211211 
    212212        void writeIndexBlocks(); 
    213          
     213 
    214214        bool addFileReference(pos_type position, size_type size, const std::string& fileName); 
    215          
     215 
    216216        static float        s_currentSupportedVersion; 
    217217        float               _version; 
     
    224224        IndexBlockList      _indexBlockList; 
    225225        FileNamePositionMap _indexMap; 
    226          
     226 
    227227 
    228228        template <typename T> 
     
    231231            std::copy(reinterpret_cast<const char*>(&value),reinterpret_cast<const char*>(&value)+sizeof(value),ptr); 
    232232        } 
    233          
     233 
    234234        template <typename T> 
    235235        static inline void _read(char* ptr, T& value)