data: saving file contents to sqlite db
This commit is contained in:
@@ -13,6 +13,7 @@
|
||||
|
||||
struct FileInfo;
|
||||
class Graph;
|
||||
class TextAccess;
|
||||
class TokenLocation;
|
||||
class TokenLocationCollection;
|
||||
class TokenLocationFile;
|
||||
@@ -51,6 +52,8 @@ public:
|
||||
|
||||
virtual TokenLocationCollection getErrorTokenLocations(std::vector<std::string>* errorMessages) const = 0;
|
||||
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const = 0;
|
||||
|
||||
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const = 0;
|
||||
};
|
||||
|
||||
#endif // STORAGE_ACCESS_H
|
||||
|
||||
@@ -224,3 +224,13 @@ std::shared_ptr<TokenLocationFile> StorageAccessProxy::getTokenLocationOfParentS
|
||||
|
||||
return std::make_shared<TokenLocationFile>("");
|
||||
}
|
||||
|
||||
std::shared_ptr<TextAccess> StorageAccessProxy::getFileContent(const FilePath& filePath) const
|
||||
{
|
||||
if (hasSubject())
|
||||
{
|
||||
return m_subject->getFileContent(filePath);
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
@@ -42,9 +42,10 @@ public:
|
||||
) const;
|
||||
|
||||
virtual TokenLocationCollection getErrorTokenLocations(std::vector<std::string>* errorMessages) const;
|
||||
|
||||
virtual std::shared_ptr<TokenLocationFile> getTokenLocationOfParentScope(const TokenLocation* child) const;
|
||||
|
||||
virtual std::shared_ptr<TextAccess> getFileContent(const FilePath& filePath) const;
|
||||
|
||||
private:
|
||||
StorageAccess* m_subject;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user