-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathcdb_database_impl.cpp
More file actions
47 lines (33 loc) · 1.26 KB
/
cdb_database_impl.cpp
File metadata and controls
47 lines (33 loc) · 1.26 KB
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
45
46
47
#include "compilation_db/impl/cdb_database_impl.hpp"
#include "compilation_db/impl/cdb_command_object_impl.hpp"
#include "exception/ih/exc_internal_error.hpp"
#include <string_view>
//------------------------------------------------------------------------------
namespace compilation_db
{
//------------------------------------------------------------------------------
DatabaseImpl::DatabaseImpl() = default;
DatabaseImpl::~DatabaseImpl() = default;
//------------------------------------------------------------------------------
DatabaseImpl::IndexType DatabaseImpl::getCount() const
{
return m_objects.size();
}
//------------------------------------------------------------------------------
const CommandObject & DatabaseImpl::getObject( IndexType _index ) const
{
const CommandObjectPtr & objectPtr = m_objects.at( _index );
INTERNAL_CHECK_ERROR( objectPtr );
return *objectPtr;
}
//------------------------------------------------------------------------------
void DatabaseImpl::addCommand(
std::string_view _directory,
std::string_view _command,
std::string_view _file )
{
m_objects.push_back(
std::make_unique< CommandObjectImpl >( _directory, _command, _file ) );
}
//------------------------------------------------------------------------------
}