diff options
Diffstat (limited to 'src/tools/src2html.c')
-rw-r--r-- | src/tools/src2html.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/tools/src2html.c b/src/tools/src2html.c index 5ebe31ee71f..2f6d1a6ca6a 100644 --- a/src/tools/src2html.c +++ b/src/tools/src2html.c @@ -332,7 +332,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // create an index file astring indexname; - indexname.printf("%s%c%s", dstdir.cstr(), PATH_SEPARATOR[0], "index.html"); + indexname.printf("%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], "index.html"); core_file *indexfile = create_file_and_output_header(indexname, tempheader, srcdir_subpath); // output the directory navigation @@ -402,7 +402,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // build the source filename astring srcfile; - srcfile.printf("%s%c%s", srcdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr()); + srcfile.printf("%s%c%s", srcdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); // if we have a file, output it astring dstfile; @@ -420,9 +420,9 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // if we got a valid file, process it if (type != FILE_TYPE_INVALID) { - dstfile.printf("%s%c%s.html", dstdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr()); + dstfile.printf("%s%c%s.html", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); if (indexfile != NULL) - core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", curlist->name.cstr(), curlist->name.cstr()); + core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", curlist->name.c_str(), curlist->name.c_str()); result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile, srcdir == dstdir, tempheader, tempfooter); } } @@ -430,9 +430,9 @@ static int recurse_dir(int srcrootlen, int dstrootlen, astring &srcdir, astring // if we have a directory, recurse else { - dstfile.printf("%s%c%s", dstdir.cstr(), PATH_SEPARATOR[0], curlist->name.cstr()); + dstfile.printf("%s%c%s", dstdir.c_str(), PATH_SEPARATOR[0], curlist->name.c_str()); if (indexfile != NULL) - core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", curlist->name.cstr(), curlist->name.cstr()); + core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", curlist->name.c_str(), curlist->name.c_str()); result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile, tempheader, tempfooter); } } @@ -467,7 +467,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & astring srcfile_subpath; normalized_subpath(srcfile_subpath, srcfile, srcrootlen + 1); - fprintf(stderr, "Processing %s\n", srcfile_subpath.cstr()); + fprintf(stderr, "Processing %s\n", srcfile_subpath.c_str()); // set some defaults bool color_quotes = false; @@ -519,7 +519,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & core_file *src; if (core_fopen(srcfile, OPEN_FLAG_READ, &src) != FILERR_NONE) { - fprintf(stderr, "Unable to read file '%s'\n", srcfile.cstr()); + fprintf(stderr, "Unable to read file '%s'\n", srcfile.c_str()); return 1; } @@ -527,7 +527,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & core_file *dst = create_file_and_output_header(dstfile, tempheader, srcfile_subpath); if (dst == NULL) { - fprintf(stderr, "Unable to write file '%s'\n", dstfile.cstr()); + fprintf(stderr, "Unable to write file '%s'\n", dstfile.c_str()); core_fclose(src); return 1; } @@ -659,7 +659,7 @@ static int output_file(file_type type, int srcrootlen, int dstrootlen, astring & astring target; if (find_include_file(target, srcrootlen, dstrootlen, srcfile, dstfile, filename)) { - dstline.catprintf("<a href=\"%s\">", target.cstr()); + dstline.catprintf("<a href=\"%s\">", target.c_str()); quotes_are_linked = true; } } @@ -738,8 +738,8 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp // print a header astring modified(templatefile); - modified.replace(0, "<!--PATH-->", path.cstr()); - core_fwrite(file, modified.cstr(), modified.len()); + modified.replace(0, "<!--PATH-->", path.c_str()); + core_fwrite(file, modified.c_str(), modified.len()); // return the file return file; @@ -754,8 +754,8 @@ static core_file *create_file_and_output_header(astring &filename, astring &temp static void output_footer_and_close_file(core_file *file, astring &templatefile, astring &path) { astring modified(templatefile); - modified.replace(0, "<!--PATH-->", path.cstr()); - core_fwrite(file, modified.cstr(), modified.len()); + modified.replace(0, "<!--PATH-->", path.c_str()); + core_fwrite(file, modified.c_str(), modified.len()); core_fclose(file); } @@ -807,7 +807,7 @@ static void output_path_as_links(core_file *file, astring &path, bool end_is_dir core_fprintf(file, "<a href=\""); for (int depth = curdepth; depth < srcdepth; depth++) core_fprintf(file, "../"); - core_fprintf(file, "index.html\">%s</a>/", substr.cstr()); + core_fprintf(file, "index.html\">%s</a>/", substr.c_str()); lastslash = slashindex + 1; } @@ -815,11 +815,11 @@ static void output_path_as_links(core_file *file, astring &path, bool end_is_dir // and a final link to the current directory astring substr(path, lastslash, -1); if (end_is_directory) - core_fprintf(file, "<a href=\"index.html\">%s</a>", substr.cstr()); + core_fprintf(file, "<a href=\"index.html\">%s</a>", substr.c_str()); else if (link_to_file) - core_fprintf(file, "<a href=\"%s\">%s</a>", substr.cstr(), substr.cstr()); + core_fprintf(file, "<a href=\"%s\">%s</a>", substr.c_str(), substr.c_str()); else - core_fprintf(file, "<a href=\"%s.html\">%s</a>", substr.cstr(), substr.cstr()); + core_fprintf(file, "<a href=\"%s.html\">%s</a>", substr.c_str(), substr.c_str()); } |