PlatformAddCmd.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include <Atomic/Core/StringUtils.h>
  2. #include <Atomic/IO/Log.h>
  3. #include <Atomic/IO/File.h>
  4. #include "../ToolSystem.h"
  5. #include "PlatformAddCmd.h"
  6. #include <Poco/File.h>
  7. namespace ToolCore
  8. {
  9. PlatformAddCmd::PlatformAddCmd(Context* context) : Command(context)
  10. {
  11. }
  12. PlatformAddCmd::~PlatformAddCmd()
  13. {
  14. }
  15. bool PlatformAddCmd::Parse(const Vector<String>& arguments, unsigned startIndex, String& errorMsg)
  16. {
  17. String argument = arguments[startIndex].ToLower();
  18. String value = startIndex + 1 < arguments.Size() ? arguments[startIndex + 1] : String::EMPTY;
  19. if (argument != "platform-add")
  20. {
  21. errorMsg = "Unable to parse build command";
  22. return false;
  23. }
  24. if (!value.Length())
  25. {
  26. errorMsg = "Unable to parse build platform";
  27. return false;
  28. }
  29. platformToAdd_ = value.ToLower();
  30. return true;
  31. }
  32. void PlatformAddCmd::Run()
  33. {
  34. LOGINFOF("Adding platform: %s", platformToAdd_.CString());
  35. ToolSystem* tsystem = GetSubsystem<ToolSystem>();
  36. Project* project = tsystem->GetProject();
  37. Platform* platform = NULL;
  38. Finished();
  39. }
  40. }