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

Ran script to remove trailing spaces and tabs

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgPlugins/gz/ReaderWriterGZ.cpp

    r12292 r13041  
    1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 Robert Osfield  
     1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2008 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*/ 
     
    3232{ 
    3333    public: 
    34      
     34 
    3535        enum ObjectType 
    3636        { 
     
    4343 
    4444        ReaderWriterGZ(); 
    45        
     45 
    4646        ~ReaderWriterGZ(); 
    4747 
    4848        virtual const char* className() const { return "HTTP Protocol Model Reader"; } 
    49                                                                                              
     49 
    5050        virtual ReadResult openArchive(const std::string& fileName,ArchiveStatus status, unsigned int , const Options* options) const 
    5151        { 
     
    5858            return readFile(OBJECT,fileName,options); 
    5959        } 
    60                                                                                              
     60 
    6161        virtual ReadResult readImage(const std::string& fileName, const osgDB::ReaderWriter::Options* options) const 
    6262        { 
     
    7575 
    7676        ReadResult readFile(ObjectType objectType, osgDB::ReaderWriter* rw, std::istream& fin, const osgDB::ReaderWriter::Options* options) const; 
    77          
     77 
    7878        ReadResult readFile(ObjectType objectType, const std::string& fullFileName, const osgDB::ReaderWriter::Options* options) const; 
    7979 
     
    8484            return writeFile(OBJECT, &obj, fileName, options); 
    8585        } 
    86                                                                                              
     86 
    8787        virtual WriteResult writeImage(const osg::Image& image, const std::string& fileName, const osgDB::ReaderWriter::Options* options) const 
    8888        { 
     
    101101 
    102102        WriteResult writeFile(ObjectType objectType, const osg::Object* object, osgDB::ReaderWriter* rw, std::ostream& fin, const osgDB::ReaderWriter::Options* options) const; 
    103          
     103 
    104104        WriteResult writeFile(ObjectType objectType, const osg::Object* object, const std::string& fullFileName, const osgDB::ReaderWriter::Options* options) const; 
    105105 
     
    107107        bool read(std::istream& fin, std::string& destination) const; 
    108108        bool write(std::ostream& fout, const std::string& source) const; 
    109          
     109 
    110110 
    111111}; 
     
    149149 
    150150    if (osgDB::equalCaseInsensitive(ext,"osgz")) 
    151     {   
     151    { 
    152152        rw = osgDB::Registry::instance()->getReaderWriterForExtension("osg"); 
    153153        OSG_INFO<<"osgz ReaderWriter "<<rw<<std::endl; 
     
    160160    else 
    161161    { 
    162         std::string baseFileName = osgDB::getNameLessExtension(fullFileName);         
     162        std::string baseFileName = osgDB::getNameLessExtension(fullFileName); 
    163163        std::string baseExt = osgDB::getLowerCaseFileExtension(baseFileName); 
    164164        rw = osgDB::Registry::instance()->getReaderWriterForExtension(baseExt); 
     
    170170    if (fileName.empty()) return ReadResult::FILE_NOT_FOUND; 
    171171 
    172     // code for setting up the database path so that internally referenced file are searched for on relative paths.  
     172    // code for setting up the database path so that internally referenced file are searched for on relative paths. 
    173173    osg::ref_ptr<Options> local_opt = options ? static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options; 
    174174    local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName)); 
     
    176176    osgDB::ifstream fin(fileName.c_str(), std::ios::binary|std::ios::in); 
    177177    if (!fin) return ReadResult::ERROR_IN_READING_FILE; 
    178      
     178 
    179179 
    180180    std::string dest; 
     
    208208 
    209209    if (osgDB::equalCaseInsensitive(ext,"osgz")) 
    210     {   
     210    { 
    211211        rw = osgDB::Registry::instance()->getReaderWriterForExtension("osg"); 
    212212        OSG_NOTICE<<"osgz ReaderWriter "<<rw<<std::endl; 
     
    219219    else 
    220220    { 
    221         std::string baseFileName = osgDB::getNameLessExtension(fullFileName);         
     221        std::string baseFileName = osgDB::getNameLessExtension(fullFileName); 
    222222        std::string baseExt = osgDB::getLowerCaseFileExtension(baseFileName); 
    223223        rw = osgDB::Registry::instance()->getReaderWriterForExtension(baseExt); 
    224224        OSG_NOTICE<<baseExt<<" ReaderWriter "<<rw<<std::endl; 
    225225    } 
    226      
     226 
    227227    std::stringstream strstream; 
    228228    osgDB::ReaderWriter::WriteResult writeResult = writeFile(objectType, object, rw, strstream, options); 
    229      
     229 
    230230    osgDB::ofstream fout(fullFileName.c_str(), std::ios::binary|std::ios::out); 
    231      
     231 
    232232    write(fout,strstream.str()); 
    233      
     233 
    234234    return writeResult; 
    235235} 
     
    262262        fin.read((char*)in, CHUNK); 
    263263        strm.avail_in = fin.gcount(); 
    264          
     264 
    265265        if (fin.bad()) 
    266266        { 
     
    288288 
    289289            destination.append((char*)out, have); 
    290              
     290 
    291291        } while (strm.avail_out == 0); 
    292292 
     
    305305    z_stream strm; 
    306306    unsigned char out[CHUNK]; 
    307      
     307 
    308308    int level = 6; 
    309309    int stategy = Z_DEFAULT_STRATEGY; // looks to be the best for .osg/.ive files 
     
    316316    strm.zfree = Z_NULL; 
    317317    strm.opaque = Z_NULL; 
    318     ret = deflateInit2(&strm,  
     318    ret = deflateInit2(&strm, 
    319319                       level, 
    320320                       Z_DEFLATED, 
     
    344344 
    345345        if (have>0) fout.write((const char*)out, have); 
    346          
     346 
    347347        if (fout.fail()) 
    348348        {