* Expand ~ in paths, all uses should be covered.

* Moved option file parsing to VariableMap and added "import" and
"try_import" options for loading option files.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@636 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2006-02-11 15:34:53 +00:00
parent e5c5f7ecb1
commit 4dea195340
13 changed files with 112 additions and 120 deletions
+10 -1
View File
@@ -39,6 +39,7 @@
#include <map>
#include <string>
#include <iosfwd>
#include <torrent/bencode.h>
namespace utils {
@@ -50,6 +51,10 @@ public:
typedef std::map<std::string, Variable*> base_type;
typedef torrent::Bencode mapped_type;
static const int max_size_key = 128;
static const int max_size_opt = 1024;
static const int max_size_line = max_size_key + max_size_opt + 64;
using base_type::iterator;
using base_type::value_type;
@@ -66,8 +71,12 @@ public:
void set(const std::string& key, const mapped_type& arg);
void set_string(const std::string& key, const std::string& arg) { set(key, mapped_type(arg)); }
// Temporary.
// Relocate.
void process_command(const std::string& command);
void process_stream(std::istream* str);
bool process_file(const std::string& path);
void process_file_throw(const std::string& path);
void process_file_nothrow(const std::string& path);
private:
VariableMap(const VariableMap&);