예제 #1
0
 public void generateHeader(
     final ImmutableList<Enum> allEnums,
     final ImmutableList<Struct> allStructs,
     final ImmutableList<Request> allRequests)
     throws IOException, ParseException {
   final Path path = Paths.get("src/ds3.h");
   final Header header = HeaderConverter.toHeader(allEnums, allStructs, allRequests);
   processTemplate(header, "header-templates/ds3_h.ftl", fileUtils.getOutputFile(path));
 }
예제 #2
0
  public void generateSource(
      final ImmutableList<Enum> allEnums,
      final ImmutableList<Struct> allStructs,
      final ImmutableList<Request> allRequests)
      throws IOException, ParseException {

    final Source source = SourceConverter.toSource(allEnums, allStructs, allRequests);
    final Path path = Paths.get("src/ds3.c");
    processTemplate(source, "source-templates/ds3_c.ftl", fileUtils.getOutputFile(path));
  }
예제 #3
0
  public void generateStaticFiles() throws IOException {
    final Path ds3RequestPath = Paths.get("src/ds3_request.h");
    processTemplate(
        null, "other-templates/ds3_request_h.ftl", fileUtils.getOutputFile(ds3RequestPath));

    final Path ds3NetPath = Paths.get("src/ds3_net.c");
    processTemplate(null, "other-templates/ds3_net_c.ftl", fileUtils.getOutputFile(ds3NetPath));
    final Path ds3NetHeaderPath = Paths.get("src/ds3_net.h");
    processTemplate(
        null, "other-templates/ds3_net_h.ftl", fileUtils.getOutputFile(ds3NetHeaderPath));

    final Path ds3ConnectionPath = Paths.get("src/ds3_connection.c");
    processTemplate(
        null, "other-templates/ds3_connection_c.ftl", fileUtils.getOutputFile(ds3ConnectionPath));
    final Path ds3ConnectionHeaderPath = Paths.get("src/ds3_connection.h");
    processTemplate(
        null,
        "other-templates/ds3_connection_h.ftl",
        fileUtils.getOutputFile(ds3ConnectionHeaderPath));
  }