Initial refactoring of metadata logging.
[cumulus.git] / util.h
1 /* LBS: An LFS-inspired filesystem backup system
2  * Copyright (C) 2006  Michael Vrable
3  *
4  * Utility functions for converting various datatypes to text format (and
5  * later, for parsing them back, perhaps).
6  */
7
8 #ifndef _LBS_FORMAT_H
9 #define _LBS_FORMAT_H
10
11 #include <iostream>
12 #include <map>
13 #include <string>
14
15 std::string uri_encode(const std::string &in);
16 std::string uri_decode(const std::string &in);
17 std::string encode_int(long long n, int base=10);
18 std::string encode_dict(const std::map<std::string, std::string>& dict);
19 void dict_output(std::ostream &o,
20                  const std::map<std::string, std::string>& dict);
21
22 long long parse_int(const std::string &s);
23
24 #endif // _LBS_TARSTORE_H