13 #ifndef __STOUT_FLAGS_FETCH_HPP__
14 #define __STOUT_FLAGS_FETCH_HPP__
46 const std::string path = value.substr(7);
50 return Error(
"Error reading file '" + path +
"': " + read.
error());
53 return parse<T>(read.
get());
56 return parse<T>(value);
64 return parse<Path>(value);
74 return parse<SecurePathOrValue>(value);
79 #endif // __STOUT_FLAGS_FETCH_HPP__
Definition: errorbase.hpp:35
Try< T > fetch(const std::string &value)
Definition: fetch.hpp:38
static Try error(const E &e)
Definition: try.hpp:42
Result< std::string > read(int_fd fd, size_t size)
Definition: read.hpp:50
#define flags
Definition: decoder.hpp:18
bool isError() const
Definition: try.hpp:71
Result< Credentials > read(const Path &path)
Definition: credentials.hpp:35
bool startsWith(const std::string &s, const std::string &prefix)
Definition: strings.hpp:380
const T & get() const
Definition: try.hpp:73