logic: added "serialize" method for indexer commands
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
#include "data/indexer/IndexerCommandJava.h"
|
||||
|
||||
#include <QJsonArray>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
IndexerCommandType IndexerCommandJava::getStaticIndexerCommandType()
|
||||
@@ -49,3 +52,22 @@ std::vector<FilePath> IndexerCommandJava::getClassPath() const
|
||||
{
|
||||
return m_classPath;
|
||||
}
|
||||
|
||||
QJsonObject IndexerCommandJava::doSerialize() const
|
||||
{
|
||||
QJsonObject jsonObject = IndexerCommand::doSerialize();
|
||||
|
||||
{
|
||||
QJsonArray classPathArray;
|
||||
for (const FilePath& classPath : m_classPath)
|
||||
{
|
||||
classPathArray.append(QString::fromStdWString(classPath.wstr()));
|
||||
}
|
||||
jsonObject["class_path"] = classPathArray;
|
||||
}
|
||||
{
|
||||
jsonObject["language_standard"] = QString::fromStdString(m_languageStandard);
|
||||
}
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
@@ -27,6 +27,9 @@ public:
|
||||
void setClassPath(std::vector<FilePath> classPath);
|
||||
std::vector<FilePath> getClassPath() const;
|
||||
|
||||
protected:
|
||||
QJsonObject doSerialize() const override;
|
||||
|
||||
private:
|
||||
const std::string m_languageStandard;
|
||||
std::vector<FilePath> m_classPath;
|
||||
|
||||
Reference in New Issue
Block a user