Index: lemon/bits/item_reader.h
===================================================================
--- lemon/bits/item_reader.h	(revision 2016)
+++ lemon/bits/item_reader.h	(revision 2254)
@@ -39,4 +39,110 @@
   /// \ingroup item_io
   ///
+  /// \brief Reader class for unformatted strings.
+  ///
+  /// Reader class for unformatted strings. This class want to be
+  /// a general reader type which can read the most 
+  ///
+  /// \author Balazs Dezso
+  class UnformattedReader {
+  public:
+    /// \brief The value type of reader.
+    ///
+    /// The value type of reader.
+    typedef std::string Value;
+    
+    /// \brief Constructor for the reader.
+    ///
+    /// Constructor for the reader.
+    UnformattedReader() {} 
+    
+    /// \brief Reads an unformatted string from the given stream.
+    ///
+    /// Reads an unformatted string from the given stream.
+    void read(std::istream& is, std::string& value) const {
+      char c;
+      value.clear();
+      is >> std::ws;
+      while (is.get(c) && !whiteSpace(c)) {
+        processChar(c, is, value);
+      }
+    }
+
+  private:
+
+    void processChar(char c, std::istream& is, Value& value) const {
+      switch (c) {
+      case '(':
+        is.putback(c);
+        readParsed('(', ')', is, value);
+        break;
+      case '[':
+        is.putback(c);
+        readParsed('[', ']', is, value);
+        break;
+      case '{':
+        is.putback(c);
+        readParsed('{', '}', is, value);
+        break;
+      case '/':
+        is.putback(c);
+        readParsed('/', '/', is, value);
+        break;
+      case '\"':
+        is.putback(c);
+        readQuoted('\"', is, value);
+        break;
+      case '\'':
+        is.putback(c);
+        readQuoted('\'', is, value);
+        break;
+      default:
+        value += c;
+        break;
+      }
+    }
+
+    void readParsed(char open, char close, 
+                    std::istream& is, Value& value) const {
+      char c;
+      if (!is.get(c) || c != open)
+	throw DataFormatError("Unformatted string format error");
+      value += c;
+      while (is.get(c) && c != close) {
+        processChar(c, is, value);
+      }
+      if (!is) 
+        throw DataFormatError("Unformatted string format error");
+      value += c;      
+    }
+
+    void readQuoted(char quote, std::istream& is, Value& value) const {
+      char c;
+      bool esc = false;
+      if (!is.get(c) || c != quote)
+	throw DataFormatError("Unformatted string format error");
+      value += c;
+      while (is.get(c) && (c != quote || esc)) {
+        if (c == '\\') esc = !esc;
+        else esc = false;
+        value += c;
+      }
+      if (!is) 
+        throw DataFormatError("Unformatted string format error");
+      value += c;
+    }
+
+
+
+    static bool whiteSpace(char c) {
+      return c == ' ' || c == '\t' || c == '\v' || 
+        c == '\n' || c == '\r' || c == '\f'; 
+    }
+
+    
+  };
+
+  /// \ingroup item_io
+  ///
   /// \brief Reader class for quoted strings.
   ///
@@ -46,4 +152,5 @@
   /// \author Balazs Dezso
   class QuotedStringReader {
+    friend class QuotedCharReader;
   public:
     /// \brief The value type of reader.
@@ -67,5 +174,5 @@
       is >> std::ws;
       if (!is.get(c) || c != '\"') 
-	throw DataFormatError("Quoted string format error");
+	throw DataFormatError("Quoted format error");
       while (is.get(c) && c != '\"') {
 	if (escaped && c == '\\') {
@@ -75,5 +182,5 @@
 	}
       }
-      if (!is) throw DataFormatError("Quoted string format error");
+      if (!is) throw DataFormatError("Quoted format error");
     }
 
@@ -153,4 +260,49 @@
 
   /// \ingroup item_io
+  ///
+  /// \brief Reader class for quoted strings.
+  ///
+  /// Reader class for quoted strings. It can process the escape
+  /// sequences in the string.
+  ///
+  /// \author Balazs Dezso
+  class QuotedCharReader {
+  public:
+    /// \brief The value type of reader.
+    ///
+    /// The value type of reader.
+    typedef char Value;
+    
+    /// \brief Constructor for the reader.
+    ///
+    /// Constructor for the reader. If the given parameter is true
+    /// the reader processes the escape sequences.
+    QuotedCharReader(bool _escaped = true) 
+      : escaped(_escaped) {}
+    
+    /// \brief Reads a quoted string from the given stream.
+    ///
+    /// Reads a quoted string from the given stream.
+    void read(std::istream& is, char& value) const {
+      char c;
+      is >> std::ws;
+      if (!is.get(c) || c != '\'') 
+	throw DataFormatError("Quoted format error");
+      if (!is.get(c)) 
+        throw DataFormatError("Quoted format error");
+      if (escaped && c == '\\') {
+        value = QuotedStringReader::readEscape(is);
+      } else {
+        value = c;
+      }
+      if (!is.get(c) || c != '\'') 
+	throw DataFormatError("Quoted format error");
+    }
+
+  private:
+    bool escaped;
+  };
+
+  /// \ingroup item_io
   /// \brief Reader for standard containers.
   ///
@@ -272,4 +424,5 @@
     void read(std::istream& is, Value& value) const {
       char c;
+      value.clear();
       if (!(is >> c) || c != open) {
 	throw DataFormatError("ParsedStringReader format error");
@@ -408,5 +561,6 @@
     void read(std::istream& is, Value& value) const {
       char c;
-      if (!(is >> std::ws >> c)) return;
+      if (!(is >> std::ws >> c)) 
+        throw DataFormatError("DefaultReader<string> format error");
       is.putback(c);
       switch (c) {
@@ -414,20 +568,53 @@
 	QuotedStringReader().read(is, value);
 	break;
-      case '(':
-	ParsedStringReader().read(is, value);
+      default:
+        UnformattedReader().read(is, value);
 	break;
-      case '[':
-	ParsedStringReader('[', ']').read(is, value);
-	break;
-      case '/':
-	ParsedStringReader('/', '/').read(is, value);
+      }
+    }
+    
+  };
+
+  template <>
+  class DefaultReader<char> {
+  public:
+    typedef char Value;
+    
+    void read(std::istream& is, Value& value) const {
+      char c;
+      if (!(is >> std::ws >> c))
+        throw DataFormatError("DefaultReader<char> format error");
+      is.putback(c);
+      switch (c) {
+      case '\'':
+	QuotedCharReader().read(is, value);
 	break;
       default:
-	if (!(is >> value)) 
-	  throw DataFormatError("DefaultReader format error");
-	break;
-      }
-    }
-    
+        { 
+          int temp;          
+          if (!(is >> temp)) 
+            throw DataFormatError("DefaultReader<char> format error");
+          value = (char)temp;
+          break;
+        }
+      }
+    }    
+  };
+
+  template <>
+  class DefaultReader<bool> {
+  public:
+    typedef bool Value;
+    
+    void read(std::istream& is, Value& value) const {
+      std::string rep;
+      if (!(is >> rep))
+        throw DataFormatError("DefaultReader<bool> format error");
+      if (rep == "true" || rep == "t" || rep == "1") {
+        value = true;
+      } else if (rep == "false" || rep == "f" || rep == "0") {
+        value = false;
+      } else throw DataFormatError("DefaultReader<bool> format error");
+    }    
   };
 
@@ -473,5 +660,5 @@
   ///
   /// \author Balazs Dezso
-  class DefaultSkipper : public DefaultReader<std::string> {};
+  class DefaultSkipper : public UnformattedReader {};
 
   /// \ingroup item_io  
Index: lemon/bits/item_writer.h
===================================================================
--- lemon/bits/item_writer.h	(revision 1956)
+++ lemon/bits/item_writer.h	(revision 2254)
@@ -25,4 +25,5 @@
 
 #include <iostream>
+#include <sstream>
 #include <string>
 
@@ -40,8 +41,99 @@
   /// \brief Writer class for quoted strings.
   ///
+  /// Writer class for unformatted strings.
+  /// \author Balazs Dezso
+  class UnformattedWriter {
+  public:
+    typedef std::string Value;
+
+    /// \brief Constructor for the writer.
+    ///
+    /// Constructor for the writer.
+    UnformattedWriter() {}
+
+    /// \brief Writes an unformatted string to the given stream.
+    ///
+    /// Writes an unformatted string to the given stream.
+    void write(std::ostream& os, const std::string& value) const {
+      os << value;
+    }
+
+    bool readable(const std::string& value) const {
+      std::istringstream is(value);
+      char c;
+      while (is.get(c) && !whiteSpace(c)) {
+        if (!processChar(c, is)) return false;
+      }
+      if (is) return false;
+      return true;
+    }
+
+  private:
+
+    bool processChar(char c, std::istream& is) const {
+      switch (c) {
+      case '(':
+        is.putback(c);
+        if (!readableParsed('(', ')', is)) return false;
+        break;
+      case '[':
+        is.putback(c);
+        if (!readableParsed('[', ']', is)) return false;
+        break;
+      case '{':
+        is.putback(c);
+        if (!readableParsed('{', '}', is)) return false;
+        break;
+      case '\"':
+        is.putback(c);
+        if (!readableQuoted('\"', is)) return false;
+        break;
+      case '\'':
+        is.putback(c);
+        if (!readableQuoted('\'', is)) return false;
+        break;
+      default:
+        break;
+      }
+      return true;
+    }
+
+    bool readableParsed(char open, char close, std::istream& is) const {
+      char c;
+      if (!is.get(c) || c != open) return false;
+      while (is.get(c) && c != close) {
+        if (!processChar(c, is)) return false;
+      }
+      if (!is) return false;
+      return true;
+    }
+
+    bool readableQuoted(char quote, std::istream& is) const {
+      char c;
+      bool esc = false;
+      if (!is.get(c) || c != quote) return false;
+      while (is.get(c) && c != quote && !esc) {
+        if (c == '\\') esc = !esc;
+        else esc = false;
+      }
+      if (!is) return false;
+      return true;
+    }
+
+    static bool whiteSpace(char c) {
+      return c == ' ' || c == '\t' || c == '\v' || 
+        c == '\n' || c == '\r' || c == '\f'; 
+    }
+
+  };
+
+  /// \ingroup item_io
+  /// \brief Writer class for quoted strings.
+  ///
   /// Writer class for quoted strings. It can process the escape
   /// sequences in the string.
   /// \author Balazs Dezso
   class QuotedStringWriter {
+    friend class QuotedCharWriter;
   public:
     typedef std::string Value;
@@ -121,4 +213,39 @@
 
   /// \ingroup item_io
+  /// \brief Writer class for quoted chars.
+  ///
+  /// Writer class for quoted char. It can process the escape
+  /// sequences in the string.
+  /// \author Balazs Dezso
+  class QuotedCharWriter {
+  public:
+    typedef char Value;
+
+    /// \brief Constructor for the writer.
+    ///
+    /// Constructor for the writer. If the given parameter is true
+    /// the writer creates escape sequences from special characters.
+    QuotedCharWriter(bool _escaped = true) : escaped(_escaped) {}
+
+    /// \brief Writes a quoted char to the given stream.
+    ///
+    /// Writes a quoted char to the given stream.
+    void write(std::ostream& os, const char& value) const {
+      os << "\'";
+      if (escaped) {
+	std::ostringstream ls;
+        QuotedStringWriter::writeEscape(ls, value);
+	os << ls.str();
+      } else {
+	os << value;
+      }
+      os << "\'";
+    }
+
+  private:
+    bool escaped;
+  };
+
+  /// \ingroup item_io
   /// \brief Writer class for quoted char array.
   ///
@@ -259,6 +386,32 @@
 
   template <>
-  class DefaultWriter<std::string> 
-    : public QuotedStringWriter {};
+  class DefaultWriter<std::string> {
+  public:
+    typedef std::string Value;
+    
+    void write(std::ostream& os, const Value& value) const {
+      if (UnformattedWriter().readable(value)) {
+        UnformattedWriter().write(os, value);
+      } else {
+        QuotedStringWriter().write(os, value);
+      }
+    }
+      
+  };
+
+  template <>
+  class DefaultWriter<char> 
+    : public QuotedCharWriter {};
+
+  template <>
+  class DefaultWriter<bool> {
+  public:
+    typedef bool Value;
+    
+    void write(std::ostream& os, const Value& value) const {
+      os << (value ? "1" : "0");
+    }
+      
+  };
 
   template <int length>
