Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
category.cpp
Go to the documentation of this file.
1/*
2 Category - tree like classification of Assets
3
4 Copyright (C)
5 2008, Hermann Vosseler <Ichthyostega@web.de>
6
7  **Lumiera** is free software; you can redistribute it and/or modify it
8  under the terms of the GNU General Public License as published by the
9  Free Software Foundation; either version 2 of the License, or (at your
10  option) any later version. See the file COPYING for further details.
11
12* *****************************************************************/
13
14
21#include "lib/util.hpp"
22#include "include/logging.h"
23
24#include <boost/algorithm/string.hpp>
25
26using boost::algorithm::starts_with;
27using util::isnil;
28
29namespace steam {
30namespace asset {
31
35 Category::operator string () const
36 {
37 using SymID = const char * const;
38
39 SymID kinds[6] = { "AUDIO"
40 , "VIDEO"
41 , "EFFECT"
42 , "CODEC"
43 , "STRUCT"
44 , "META"
45 };
46 REQUIRE ( 0<=kind_ && kind_< 6 );
47 string str (kinds[kind_]);
48 if (!isnil (path_))
49 str += "/"+path_;
50 return str;
51 }
52
53
54
59 bool
60 Category::isWithin (const Category& ref) const
61 {
62 return ( ref.hasKind (kind_)
63 and starts_with (path_, ref.path_)
64 );
65 }
66
67
68}} // namespace asset
Definition of Asset categorisation.
Tree like classification of Assets.
Definition category.hpp:68
bool isWithin(Category const &) const
hierarchical inclusion test.
Definition category.cpp:60
bool hasKind(Kind refKind) const
Definition category.hpp:79
This header is for including and configuring NoBug.
The asset subsystem of the Steam-Layer.
Steam-Layer implementation namespace root.
bool isnil(lib::time::Duration const &dur)
Tiny helper functions and shortcuts to be used everywhere Consider this header to be effectively incl...