1
// -*- Mode: C++; indent-tabs-mode: nil; tab-width: 2 -*-
3
* Copyright (C) 2011 Canonical Ltd
5
* This program is free software: you can redistribute it and/or modify
6
* it under the terms of the GNU General Public License version 3 as
7
* published by the Free Software Foundation.
9
* This program is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program. If not, see <http://www.gnu.org/licenses/>.
17
* Authored by: Andrea Azzarone <azzaronea@gmail.com>
33
* Fills the object given a list of uris.
35
void Fill(const char* uris);
38
* Resets the object. Call this function when no longer need data
43
* Returns a std::set<std::string> with all the uris.
45
std::set<std::string> const& Uris() const { return uris_; }
48
* Returns a std::set<std::string> with all the types.
50
std::set<std::string> const& Types() const { return types_; }
53
* Returns a std::set<std::string> with all uris of a given type.
55
std::set<std::string> const& UrisByType(const std::string& type) const { return types_to_uris_.find(type)->second; }
58
* Returns a std::set<std::string> with all types of a given uri.
60
std::string const& TypeByUri(const std::string& uris) { return uris_to_types_.find(uris)->second; }
63
std::set<std::string> uris_;
64
std::set<std::string> types_;
65
std::map<std::string, std::string> uris_to_types_;
66
std::map<std::string, std::set<std::string>> types_to_uris_;