示例#1
0
bool utl::getAttribute (const TiXmlElement* xml, const char* att,
                        std::vector<int>& val)
{
  if (xml && xml->Attribute(att))
    parseIntegers(val,xml->Attribute(att));
  else
    return false;

  return true;
}
示例#2
0
int main(int argc, char const *argv[]) {
  validateArgsLength(argc, argv);
  /* Convert coded message to an int array if it consists of valid integers */
  int *codedMessage = parseIntegers(argc, argv);

  printArgs(argc, argv);

  /* Process wheel file and print wheel values */
  char* flatWheel = parseWheelFile(argv[1]);
  printf("Decoding wheel values:\n  %s\n\n", flatWheel);

  /* Construct a decoding wheel */
  Node* root = constructWheel(flatWheel);

  /* Decode and print coded message */
  char *decodedMessage = decodeMessage(root, codedMessage, argc-2);
  printf("Decoded message:\n  %s\n\n", decodedMessage);

  return 0;
}