libzypp 17.31.23
LoadTestcase.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_MISC_LOADTESTCASE_H
13#define ZYPP_MISC_LOADTESTCASE_H
14
15#include <zypp/Pathname.h>
16#include <zypp/Url.h>
17#include <zypp/base/PtrTypes.h>
18#include <zypp/base/NonCopyable.h>
20
21#include <optional>
22#include <memory>
23
24namespace zypp::misc::testcase {
25
27 {
28 struct Node {
29 struct Impl;
30
31 Node();
32 ~Node();
33 const std::string &name () const;
34 std::string &name ();
35 const std::string &value () const;
36 std::string &value ();
37
38 const std::string &getProp( const std::string &name, const std::string &def = std::string() ) const;
39 const std::map<std::string, std::string> &properties() const;
40 std::map<std::string, std::string> &properties();
41 const std::vector<std::shared_ptr<Node>> &children() const;
42 std::vector<std::shared_ptr<Node>> &children();
43
44 private:
46
47 };
48
51 const std::vector<Node> &nodes () const;
52 std::vector<Node> &nodes ();
53 private:
54 struct Impl;
56 };
57
59 {
60 public:
61 struct Impl;
62 using TestcaseTrials = std::vector<TestcaseTrial>;
63
64 enum Type {
67 Yaml
68 };
69
72
73 bool loadTestcaseAt ( const zypp::Pathname &path, std::string *err );
74 static Type testcaseTypeAt ( const zypp::Pathname &path );
75
76 const TestcaseSetup &setupInfo() const;
77 const TestcaseTrials &trialInfo() const;
78
79 private:
80 std::unique_ptr<Impl> _pimpl;
81 };
82
83}
84
85
86#endif // ZYPP_MISC_LOADTESTCASE_H
const TestcaseSetup & setupInfo() const
const TestcaseTrials & trialInfo() const
std::unique_ptr< Impl > _pimpl
Definition: LoadTestcase.h:80
static Type testcaseTypeAt(const zypp::Pathname &path)
bool loadTestcaseAt(const zypp::Pathname &path, std::string *err)
std::vector< TestcaseTrial > TestcaseTrials
Definition: LoadTestcase.h:62
boost::noncopyable NonCopyable
Ensure derived classes cannot be copied.
Definition: NonCopyable.h:26
RW_pointer supporting 'copy on write' functionality.
Definition: PtrTypes.h:459
const std::vector< std::shared_ptr< Node > > & children() const
Definition: LoadTestcase.cc:90
const std::string & name() const
Definition: LoadTestcase.cc:66
const std::string & getProp(const std::string &name, const std::string &def=std::string()) const
Definition: LoadTestcase.cc:78
const std::map< std::string, std::string > & properties() const
Definition: LoadTestcase.cc:84
const std::string & value() const
Definition: LoadTestcase.cc:72
const std::vector< Node > & nodes() const
Definition: LoadTestcase.cc:54
RWCOW_pointer< Impl > _pimpl
Definition: LoadTestcase.h:55