logic: solution parsing refactor
Refactored solution parser handling to make it more generic Also includes new parser (wip)
This commit is contained in:
@@ -99,10 +99,11 @@ void IDECommunicationController::handleCreateProjectMessage(const NetworkProtoco
|
||||
{
|
||||
if (message.valid)
|
||||
{
|
||||
if (message.ideId == NetworkProtocolHelper::CreateProjectMessage::IDE_ID::VS)
|
||||
if (message.ideId == "vs")
|
||||
{
|
||||
MessageProjectNew msg;
|
||||
msg.setVisualStudioSolutionPath(message.solutionFileLocation);
|
||||
msg.setSolutionPath(message.solutionFileLocation);
|
||||
msg.ideId = message.ideId;
|
||||
msg.dispatch();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -3,8 +3,12 @@
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include <boost/algorithm/string.hpp>
|
||||
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
#include "utility/solution/SolutionParserVisualStudio.h"
|
||||
|
||||
std::string NetworkProtocolHelper::m_divider = ">>";
|
||||
std::string NetworkProtocolHelper::m_setActiveTokenPrefix = "setActiveToken";
|
||||
std::string NetworkProtocolHelper::m_moveCursorPrefix = "moveCursor";
|
||||
@@ -100,14 +104,10 @@ NetworkProtocolHelper::CreateProjectMessage NetworkProtocolHelper::parseCreatePr
|
||||
{
|
||||
networkMessage.solutionFileLocation = fileLocation;
|
||||
|
||||
if (ideId == "vs")
|
||||
{
|
||||
networkMessage.ideId = CreateProjectMessage::IDE_ID::VS;
|
||||
}
|
||||
else
|
||||
{
|
||||
networkMessage.ideId = CreateProjectMessage::IDE_ID::UNKNOWN;
|
||||
}
|
||||
std::string nonConstId = ideId;
|
||||
boost::algorithm::to_lower(nonConstId);
|
||||
|
||||
networkMessage.ideId = nonConstId;
|
||||
|
||||
networkMessage.valid = true;
|
||||
}
|
||||
|
||||
@@ -28,18 +28,12 @@ public:
|
||||
public:
|
||||
CreateProjectMessage()
|
||||
: solutionFileLocation("")
|
||||
, ideId(IDE_ID::UNKNOWN)
|
||||
, ideId("")
|
||||
, valid(false)
|
||||
{}
|
||||
|
||||
enum IDE_ID
|
||||
{
|
||||
UNKNOWN = 0,
|
||||
VS
|
||||
};
|
||||
|
||||
std::string solutionFileLocation;
|
||||
IDE_ID ideId;
|
||||
std::string ideId;
|
||||
bool valid;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user