int NlsEvent::parseMsgType()

in nlsCppSdk/framework/common/nlsEvent.cpp [373:412]


int NlsEvent::parseMsgType(std::string name) {
  if (name == "TaskFailed") {
    _msgType = NlsEvent::TaskFailed;
  } else if (name == "RecognitionStarted") {
    _msgType = NlsEvent::RecognitionStarted;
  } else if (name == "RecognitionCompleted") {
    _msgType = NlsEvent::RecognitionCompleted;
  } else if (name == "RecognitionResultChanged") {
    _msgType = NlsEvent::RecognitionResultChanged;
  } else if (name == "TranscriptionStarted") {
    _msgType = NlsEvent::TranscriptionStarted;
  } else if (name == "SentenceBegin") {
    _msgType = NlsEvent::SentenceBegin;
  } else if (name == "TranscriptionResultChanged") {
    _msgType = NlsEvent::TranscriptionResultChanged;
  } else if (name == "SentenceEnd") {
    _msgType = NlsEvent::SentenceEnd;
  } else if (name == "TranscriptionCompleted") {
    _msgType = NlsEvent::TranscriptionCompleted;
  } else if (name == "SynthesisStarted") {
    _msgType = NlsEvent::SynthesisStarted;
  } else if (name == "SynthesisCompleted") {
    _msgType = NlsEvent::SynthesisCompleted;
  } else if (name == "DialogResultGenerated") {
    _msgType = NlsEvent::DialogResultGenerated;
  } else if (name == "WakeWordVerificationCompleted") {
    _msgType = NlsEvent::WakeWordVerificationCompleted;
  } else if (name == "SentenceSemantics") {
    _msgType = NlsEvent::SentenceSemantics;
  } else if (name == "MetaInfo") {
    _msgType = NlsEvent::MetaInfo;
  } else if (name == "SentenceSynthesis") {
    _msgType = NlsEvent::SentenceSynthesis;
  } else {
    //    LOG_ERROR("EVENT: type is invalid. [%s].", _msg.c_str());
    return -(InvalidNlsEventMsgType);
  }

  return Success;
}