1 #include "stdafx.h" 2 #include "Commands/CDirectiveMessage.h" 3 #include "Core/Common.h" 4 CDirectiveMessage(Type type,Expression exp)5CDirectiveMessage::CDirectiveMessage(Type type, Expression exp) 6 { 7 errorType = type; 8 this->exp = exp; 9 } 10 Validate()11bool CDirectiveMessage::Validate() 12 { 13 std::wstring text; 14 if (exp.evaluateString(text,true) == false) 15 { 16 Logger::queueError(Logger::Error,L"Invalid expression"); 17 return false; 18 } 19 20 switch (errorType) 21 { 22 case Type::Warning: 23 Logger::queueError(Logger::Warning,text); 24 break; 25 case Type::Error: 26 Logger::queueError(Logger::Error,text); 27 break; 28 case Type::Notice: 29 Logger::queueError(Logger::Notice,text); 30 break; 31 } 32 return false; 33 }