00001 /* Copyright (c) 2008, Gennady Bystritsky <bystr@mac.com> 00002 * 00003 * Distributed under the MIT Licence. 00004 * This is free software. See 'LICENSE' for details. 00005 * You must read and accept the license prior to use. 00006 * 00007 * Author: Gennady Bystritsky 00008 */ 00009 00010 #ifndef _SK_UTIL_FILE_H_ 00011 #define _SK_UTIL_FILE_H_ 00012 00013 #include <sk/util/String.h> 00014 #include <fstream> 00015 00016 namespace sk { 00017 namespace util { 00018 class File 00019 { 00020 public: 00021 File(const sk::util::String& name); 00022 static bool exists(const sk::util::String& name); 00023 static void create(const sk::util::String& name); 00024 00025 const sk::util::String getLine(); 00026 const sk::util::String getLines(int number); 00027 const sk::util::String getLines(); 00028 00029 private: 00030 const sk::util::String _name; 00031 std::ifstream _file; 00032 }; 00033 } 00034 } 00035 00036 #endif /* _SK_UTIL_FILE_H_ */