Exemplo n.º 1
0
void Doclet::prewalk(Class& instance)
{
  if (instance.isForwardDeclaration()) {
    return;
  }

  if (instance.hasDocumentation()) {
    Documentation* documentation = instance.getDocumentation();
    if (documentation->containsAnnotation("@prototype") ||
	documentation->containsAnnotation("@prototyped")) {
      _hasClassAnnotationMatch = true;
      _className = instance.getName();
      _className += "Prototype";
      _fileName = _outputDir + "/" + _className + "Prototype";
    }
  }

  typedef std::vector <Attribute*>::iterator AttributeIterType;
  for (AttributeIterType iter = instance.getAttributes().begin(); iter != instance.getAttributes().end(); iter++) {
    prewalk(**iter);
  }

  typedef std::vector <Method*>::iterator MethodIterType;
  for (MethodIterType iter = instance.getMethods().begin(); iter != instance.getMethods().end(); iter++) {
    prewalk(**iter);
  }
}
Exemplo n.º 2
0
void Doclet::process(Class& instance)
{
  if (instance.isForwardDeclaration()) {
    return;
  }

  _outputBuffer += "class " + _className + "\n";
  _outputBuffer += "{\n";

  typedef std::vector <Attribute*>::iterator AttributeIterType;
  for (AttributeIterType iter = instance.getAttributes().begin(); iter != instance.getAttributes().end(); iter++) {
    process(**iter);
  }

  typedef std::vector <Method*>::iterator MethodIterType;
  for (MethodIterType iter = instance.getMethods().begin(); iter != instance.getMethods().end(); iter++) {
    process(**iter);
  }

  _outputBuffer += "};\n\n\n";
}