"Fossies" - the Fresh Open Source Software Archive

Member "regexxer-0.10/src/fileio.h" (6 Oct 2011, 1880 Bytes) of package /linux/privat/old/regexxer-0.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "fileio.h" see the Fossies "Dox" file reference documentation.

    1 /*
    2  * Copyright (c) 2002-2007  Daniel Elstner  <daniel.kitta@gmail.com>
    3  *
    4  * This file is part of regexxer.
    5  *
    6  * regexxer is free software; you can redistribute it and/or modify
    7  * it under the terms of the GNU General Public License as published by
    8  * the Free Software Foundation; either version 2 of the License, or
    9  * (at your option) any later version.
   10  *
   11  * regexxer is distributed in the hope that it will be useful,
   12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
   13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   14  * GNU General Public License for more details.
   15  *
   16  * You should have received a copy of the GNU General Public License
   17  * along with regexxer; if not, write to the Free Software Foundation,
   18  * Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
   19  */
   20 
   21 #ifndef REGEXXER_FILEIO_H_INCLUDED
   22 #define REGEXXER_FILEIO_H_INCLUDED
   23 
   24 #include "sharedptr.h"
   25 #include <string>
   26 #include <glibmm/refptr.h>
   27 
   28 
   29 namespace Regexxer
   30 {
   31 
   32 class FileBuffer;
   33 
   34 class FileInfoBase : public Util::SharedObject
   35 {
   36 public:
   37   virtual ~FileInfoBase() = 0;
   38 };
   39 
   40 struct DirInfo : public FileInfoBase
   41 {
   42   int file_count;
   43   int modified_count;
   44 
   45   DirInfo();
   46   virtual ~DirInfo();
   47 };
   48 
   49 struct FileInfo : public FileInfoBase
   50 {
   51   std::string               fullname;
   52   std::string               encoding;
   53   Glib::RefPtr<FileBuffer>  buffer;
   54   bool                      load_failed;
   55 
   56   explicit FileInfo(const std::string& fullname_);
   57   virtual ~FileInfo();
   58 };
   59 
   60 typedef Util::SharedPtr<FileInfoBase> FileInfoBasePtr;
   61 typedef Util::SharedPtr<DirInfo>      DirInfoPtr;
   62 typedef Util::SharedPtr<FileInfo>     FileInfoPtr;
   63 
   64 class ErrorBinaryFile {}; // exception type
   65 
   66 void load_file(const FileInfoPtr& fileinfo, const std::string& fallback_encoding);
   67 void save_file(const FileInfoPtr& fileinfo);
   68 
   69 } // namespace Regexxer
   70 
   71 #endif /* REGEXXER_FILEIO_H_INCLUDED */