data: database storage
* replaced storage by a new version that utilizes sqlite for persistence. * added SqliteStorage to manage direct access to the database. * added testsuit for sqlite. * slimmed down the protected interface of the storage. * changed tests in StorageTestSuit to avoid using protected methods of the storage. * added functions to begin and commit a transaction to the storage. * removed GraphFilterTestSuite. * removed GraphFilterConductorTestSuite. * added Node and Edge constructor that takes id as parameter * added constructor for TokenComponentNameCached that accepts NameHierarchy as parameter * added TokenLocation constructor that takes locationId as parameter. * created respective construction functions in TokenLocatonLine, -File and -Collection. fortune cookie message = Recognition will come from unexpected sources.
This commit is contained in:
@@ -68,6 +68,30 @@ TokenLocation* TokenLocationCollection::addTokenLocation(
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
TokenLocation* TokenLocationCollection::addTokenLocation(
|
||||
Id locationId, Id tokenId, const FilePath& filePath,
|
||||
unsigned int startLineNumber, unsigned int startColumnNumber,
|
||||
unsigned int endLineNumber, unsigned int endColumnNumber)
|
||||
{
|
||||
if (startLineNumber > endLineNumber || (startLineNumber == endLineNumber && startColumnNumber > endColumnNumber))
|
||||
{
|
||||
LOG_ERROR("Can't create TokenLocation with wrong boundaries.");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
TokenLocationFile* file = createTokenLocationFile(filePath);
|
||||
TokenLocation* location =
|
||||
file->addTokenLocation(locationId, tokenId, startLineNumber, startColumnNumber, endLineNumber, endColumnNumber);
|
||||
|
||||
m_locations.emplace(location->getId(), location);
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void TokenLocationCollection::removeTokenLocation(TokenLocation* location)
|
||||
{
|
||||
if (!findTokenLocationById(location->getId()))
|
||||
|
||||
Reference in New Issue
Block a user