File: engine_library_v2_low_level.cpp

package info (click to toggle)
libdjinterop 0.22.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 2,504 kB
  • sloc: cpp: 23,313; sql: 3,803; makefile: 3; sh: 2
file content (44 lines) | stat: -rw-r--r-- 1,630 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
    This file is part of libdjinterop.

    libdjinterop is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    libdjinterop is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with libdjinterop.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <iostream>

#include <djinterop/engine/engine.hpp>
#include <djinterop/engine/v2/engine_library.hpp>

namespace e = djinterop::engine;
namespace ev2 = djinterop::engine::v2;

/// Example program to demonstrate usage of the Engine v2 low-level API.
int main()
{
    std::cout << "Engine Library v2 Low-level API Example Program" << std::endl;
    std::cout << std::endl;

    auto dir = "Engine Library";
    auto exists = ev2::engine_library::exists(dir);
    auto library = exists ? ev2::engine_library{dir}
                          : ev2::engine_library::create(dir, e::latest_v2);

    std::cout << (exists ? "Loaded" : "Created")
              << " engine library:" << std::endl;
    std::cout << "Version: " << library.version().name << std::endl;
    std::cout << "Path:    " << dir << std::endl;
    std::cout << "UUID:    " << library.information().get().uuid << std::endl;

    return 0;
}