Passwordfile library 5.0.12
C++ library to read/write passwords from/to encrypted files
Loading...
Searching...
No Matches
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
12namespace CppUtilities {
13
14inline std::ostream &operator<<(std::ostream &out, const Io::Entry *entry)
15{
16 return out << joinStrings(entry->path(), "/");
17}
18
19inline 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#include <c++utilities/tests/testutils.h>
27
28using namespace CppUtilities;
29
30#endif // PASSWORDFILE_TESTS_UTILS_H
Instances of the Entry class form a hierarchic data structure used to store account information.
Definition entry.h:30
std::list< std::string > path() const
Returns the path of the entry.
Definition entry.cpp:154
The Field class holds field information which consists of a name and a value and is able to serialize...
Definition field.h:15
const std::string & name() const
Returns the name.
Definition field.h:59
const std::string & value() const
Returns the value.
Definition field.h:75
std::ostream & operator<<(std::ostream &out, const Io::Entry *entry)
Definition utils.h:14