Passwordfile library  5.0.3
C++ library to read/write passwords from/to encrypted files
utils.h
Go to the documentation of this file.
1 #ifndef PASSWORDFILE_TESTS_UTILS_H
2 #define PASSWORDFILE_TESTS_UTILS_H
3 
4 #include "../io/entry.h"
5 #include "../io/field.h"
6 
7 #include <c++utilities/conversion/stringconversion.h>
8 #include <c++utilities/misc/traits.h>
9 
10 #include <ostream>
11 
12 namespace CppUtilities {
13 
14 inline std::ostream &operator<<(std::ostream &out, const Io::Entry *entry)
15 {
16  return out << joinStrings(entry->path(), "/");
17 }
18 
19 inline std::ostream &operator<<(std::ostream &out, const Io::Field *field)
20 {
21  return out << field->name() << '=' << field->value();
22 }
23 
24 } // namespace CppUtilities
25 
26 #endif // PASSWORDFILE_TESTS_UTILS_H
Io::Entry
Instances of the Entry class form a hierarchic data strucutre used to store account information.
Definition: entry.h:30
Io::Field::value
const std::string & value() const
Returns the value.
Definition: field.h:75
CppUtilities::operator<<
std::ostream & operator<<(std::ostream &out, const Io::Entry *entry)
Definition: utils.h:14
Io::Entry::path
std::list< std::string > path() const
Returns the path of the entry.
Definition: entry.cpp:154
CppUtilities
Definition: utils.h:12
Io::Field
The Field class holds field information which consists of a name and a value and is able to serialize...
Definition: field.h:15
Io::Field::name
const std::string & name() const
Returns the name.
Definition: field.h:59