From 56d32c58868f53d7dfacb7def0eb486669321e38 Mon Sep 17 00:00:00 2001
From: valerio <valerio@5a81b35b-ba03-0410-adc8-b2c5c5119f08>
Date: Sun, 21 Mar 2010 17:35:12 +0000
Subject: [PATCH] Fixed typos, added comments

git-svn-id: https://dng.biozentrum.unibas.ch/svn/openstructure/trunk@1855 5a81b35b-ba03-0410-adc8-b2c5c5119f08
---
 modules/io/src/img/map_io_mrc_handler.cc    | 5 ++++-
 modules/io/src/img/map_io_spi_handler.hh    | 2 +-
 modules/io/src/io_utils.hh                  | 4 +++-
 modules/io/src/mol/entity_io_pdb_handler.cc | 3 ++-
 modules/io/src/seq/fasta_io_handler.cc      | 2 +-
 5 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/modules/io/src/img/map_io_mrc_handler.cc b/modules/io/src/img/map_io_mrc_handler.cc
index 924af5c13..b1513a21d 100644
--- a/modules/io/src/img/map_io_mrc_handler.cc
+++ b/modules/io/src/img/map_io_mrc_handler.cc
@@ -905,6 +905,9 @@ void MapIOMrcHandler::Import(img::MapHandle& sh, const boost::filesystem::path&
   }
   in.push(boost::iostreams::file_source(loc.string()));
   in.read(reinterpret_cast<char*>(&header_),256);
+  // seekg does not work on compressed streams
+  // the only way to rewind is closing and reopening the stream
+  // by popping out the file source and pushing it in again
   in.pop();
   in.push(boost::iostreams::file_source(loc.string()));
   is_file_=true;
@@ -941,7 +944,7 @@ void MapIOMrcHandler::Import(img::MapHandle& sh, std::istream& loc, const ImageF
      detail::import_endianess_switcher<detail::ccp4_header>(sh,loc,head_str,formatmrc);
    } else {
 	 unsigned char header_content[256];
-	 memcpy(&header_content,&header_,256*sizeof(char));
+	 memcpy(&header_content[0],&header_,256*sizeof(char));
      if (MatchContent(header_content) == true) {
        LOGN_DEBUG("mrc io: importing new style format");
        detail::import_endianess_switcher<detail::ccp4_header>(sh,loc,head_str,formatmrc);
diff --git a/modules/io/src/img/map_io_spi_handler.hh b/modules/io/src/img/map_io_spi_handler.hh
index ac62117b1..f51093d4b 100644
--- a/modules/io/src/img/map_io_spi_handler.hh
+++ b/modules/io/src/img/map_io_spi_handler.hh
@@ -66,7 +66,7 @@ class DLLEXPORT_OST_IO MapIOSpiHandler: public MapIOHandler
   static bool MatchType(const ImageFormatBase& type);
   static bool MatchSuffix(const String& loc);
   static String GetFormatName() { return String("Spider"); };
-  static String GetFormatDescription() { return String("Format sued by the Spider software package"); };
+  static String GetFormatDescription() { return String("Format used by the Spider software package"); };
 
 protected:
   void do_import(img::MapHandle& sh, std::istream& loc,const ImageFormatBase& formatstruct);
diff --git a/modules/io/src/io_utils.hh b/modules/io/src/io_utils.hh
index 677b3024a..4f404444d 100644
--- a/modules/io/src/io_utils.hh
+++ b/modules/io/src/io_utils.hh
@@ -20,11 +20,13 @@
 #ifndef OST_IO_UTIL_HH
 #define OST_IO_UTIL_HH
 
+#include <ost/io/module_config.hh>
 #include <ost/base.hh>
 
+
 namespace ost { namespace io { namespace detail {
 
-bool FilenameEndsWith(const String& target,const String& probe);
+bool DLLEXPORT_OST_IO FilenameEndsWith(const String& target,const String& probe);
 
 }}} // ns
 
diff --git a/modules/io/src/mol/entity_io_pdb_handler.cc b/modules/io/src/mol/entity_io_pdb_handler.cc
index 8ec58b26c..3ab18599f 100644
--- a/modules/io/src/mol/entity_io_pdb_handler.cc
+++ b/modules/io/src/mol/entity_io_pdb_handler.cc
@@ -77,7 +77,8 @@ bool pdb_handler_is_responsible_for(const boost::filesystem::path& loc,
                                     const String& type) {
   if(type=="auto") {
     if(detail::FilenameEndsWith(loc.string(),".pdb") || detail::FilenameEndsWith(loc.string(),".ent") ||
-       detail::FilenameEndsWith(loc.string(),".pdb.gz") || detail::FilenameEndsWith(loc.string(),".par") ){
+       detail::FilenameEndsWith(loc.string(),".pdb.gz") || detail::FilenameEndsWith(loc.string(),".pqr") ||
+       detail::FilenameEndsWith(loc.string(),".ent.gz")){
       return true;
     }
 
diff --git a/modules/io/src/seq/fasta_io_handler.cc b/modules/io/src/seq/fasta_io_handler.cc
index af2b2db50..6a6a5f103 100644
--- a/modules/io/src/seq/fasta_io_handler.cc
+++ b/modules/io/src/seq/fasta_io_handler.cc
@@ -59,7 +59,7 @@ bool FastaIOHandler::ProvidesImport(const boost::filesystem::path& loc,
 
 
    if (detail::FilenameEndsWith(loc.string(),".fasta") || detail::FilenameEndsWith(loc.string(),".fa") ||
-       detail::FilenameEndsWith(loc.string(),".fnaa") || detail::FilenameEndsWith(loc.string(),".fsa") ||
+       detail::FilenameEndsWith(loc.string(),".fna") || detail::FilenameEndsWith(loc.string(),".fsa") ||
        detail::FilenameEndsWith(loc.string(),".fas") )  {
 	return true;
    }
-- 
GitLab