summaryrefslogtreecommitdiffstatshomepage
path: root/src/tools
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2021-01-02 15:11:27 -0500
committer AJR <ajrhacker@users.noreply.github.com>2021-01-02 15:18:15 -0500
commit60e518cc505ad5de6331a5da0d8291346757b9bd (patch)
tree33e9ab6c897eacb273e6f9d41c5c0d1c9595c443 /src/tools
parent78f93a270c2b8d013128a2a346bdf0b8f98700d9 (diff)
Low-level #include overhaul
- vecstream.h: Revert changes made in aa29519528cb3dbdbfac56819bea670ed8c56c5d. The std::string_view conversion has been made a non-member function (util::buf_to_string_view) and moved to coretmpl.h. - strformat.h: Remove the using declaration importing util::string_format into the global namespace. It has been moved to emucore.h and a few tool sources; other references have been qualified. - osdcore.h: Split out file, directory and path classes and methods to a new header (osdfile.h), Doxygenizing the documentation comments. - Disaggregate many #includes that were including other standard or custom headers. emu.h now includes basically the same things that it did, but other headers have been streamlined; for instance, emucore.h no longer stealth-includes osdcore.h several ways.
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/chdman.cpp6
-rw-r--r--src/tools/floptool.cpp1
-rw-r--r--src/tools/imgtool/charconv.h4
-rw-r--r--src/tools/imgtool/imghd.cpp2
-rw-r--r--src/tools/imgtool/imgtool.h1
-rw-r--r--src/tools/imgtool/main.cpp4
-rw-r--r--src/tools/imgtool/stream.cpp1
-rw-r--r--src/tools/imgtool/stream.h1
-rw-r--r--src/tools/jedutil.cpp1
-rw-r--r--src/tools/pngcmp.cpp2
-rw-r--r--src/tools/regrep.cpp6
-rw-r--r--src/tools/romcmp.cpp2
-rw-r--r--src/tools/split.cpp2
-rw-r--r--src/tools/srcclean.cpp2
-rw-r--r--src/tools/unidasm.cpp1
15 files changed, 24 insertions, 12 deletions
diff --git a/src/tools/chdman.cpp b/src/tools/chdman.cpp
index 516e2f5b057..6bd15339b62 100644
--- a/src/tools/chdman.cpp
+++ b/src/tools/chdman.cpp
@@ -7,9 +7,6 @@
****************************************************************************/
#include <stdio.h> // must be stdio.h and here otherwise issues with I64FMT in MINGW
-// osd
-#include "osdcore.h"
-
// lib/util
#include "avhuff.h"
#include "aviio.h"
@@ -18,6 +15,7 @@
#include "corefile.h"
#include "hashing.h"
#include "md5.h"
+#include "strformat.h"
#include "vbiparse.h"
#include <cassert>
@@ -33,6 +31,8 @@
#include <new>
#include <unordered_map>
+using util::string_format;
+
//**************************************************************************
diff --git a/src/tools/floptool.cpp b/src/tools/floptool.cpp
index 364e74af68b..2a33a92a979 100644
--- a/src/tools/floptool.cpp
+++ b/src/tools/floptool.cpp
@@ -19,6 +19,7 @@
#include <cassert>
#include "corestr.h"
+#include "osdcomm.h"
#include "formats/mfi_dsk.h"
#include "formats/dfi_dsk.h"
diff --git a/src/tools/imgtool/charconv.h b/src/tools/imgtool/charconv.h
index 14a2befa233..7df16f8a615 100644
--- a/src/tools/imgtool/charconv.h
+++ b/src/tools/imgtool/charconv.h
@@ -14,6 +14,10 @@
#include "unicode.h"
+#include <sstream>
+#include <utility>
+#include <vector>
+
namespace imgtool
{
// ======================> charconverter
diff --git a/src/tools/imgtool/imghd.cpp b/src/tools/imgtool/imghd.cpp
index b868b692c63..45ac262a9ba 100644
--- a/src/tools/imgtool/imghd.cpp
+++ b/src/tools/imgtool/imghd.cpp
@@ -81,7 +81,7 @@ imgtoolerr_t imghd_create(imgtool::stream &stream, uint32_t hunksize, uint32_t c
}
/* write the metadata */
- const std::string metadata = string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, seclen);
+ const std::string metadata = util::string_format(HARD_DISK_METADATA_FORMAT, cylinders, heads, sectors, seclen);
err = (imgtoolerr_t)chd.write_metadata(HARD_DISK_METADATA_TAG, 0, metadata);
if (rc != CHDERR_NONE)
{
diff --git a/src/tools/imgtool/imgtool.h b/src/tools/imgtool/imgtool.h
index a2e9e732172..ca8d19aed85 100644
--- a/src/tools/imgtool/imgtool.h
+++ b/src/tools/imgtool/imgtool.h
@@ -21,6 +21,7 @@
#include "opresolv.h"
#include "library.h"
#include "filter.h"
+#include "osdcomm.h"
/* ----------------------------------------------------------------------- */
diff --git a/src/tools/imgtool/main.cpp b/src/tools/imgtool/main.cpp
index 55f37284d3c..e0ff03cca62 100644
--- a/src/tools/imgtool/main.cpp
+++ b/src/tools/imgtool/main.cpp
@@ -248,7 +248,7 @@ static int cmd_dir(const struct command *c, int argc, char *argv[])
{
std::string filesize_string = ent.directory
? "<DIR>"
- : string_format("%u", (unsigned int) ent.filesize);
+ : util::string_format("%u", (unsigned int) ent.filesize);
if (!ent.lastmodified_time.empty())
{
@@ -748,7 +748,7 @@ static void listoptions(const util::option_guide &opt_guide, const char *opt_spe
const util::option_resolution::entry &entry = *iter;
std::stringstream description_buffer;
- std::string opt_name = string_format("--%s", entry.identifier());
+ std::string opt_name = util::string_format("--%s", entry.identifier());
const char *opt_desc = entry.display_name();
// is this option relevant?
diff --git a/src/tools/imgtool/stream.cpp b/src/tools/imgtool/stream.cpp
index 9f6cba27353..da4cf87f8eb 100644
--- a/src/tools/imgtool/stream.cpp
+++ b/src/tools/imgtool/stream.cpp
@@ -13,7 +13,6 @@
#include <zlib.h>
#include "unzip.h"
-#include "osdcore.h"
#include "imgtool.h"
diff --git a/src/tools/imgtool/stream.h b/src/tools/imgtool/stream.h
index 2b7afbacd5e..73d0dcb494d 100644
--- a/src/tools/imgtool/stream.h
+++ b/src/tools/imgtool/stream.h
@@ -13,6 +13,7 @@
#include "imgterrs.h"
#include "corefile.h"
+#include "osdcomm.h"
namespace imgtool
{
diff --git a/src/tools/jedutil.cpp b/src/tools/jedutil.cpp
index 3f4700e22cd..0c27c1b4480 100644
--- a/src/tools/jedutil.cpp
+++ b/src/tools/jedutil.cpp
@@ -145,6 +145,7 @@
#include "corestr.h"
#include "jedparse.h"
+#include "osdcomm.h"
#include "plaparse.h"
diff --git a/src/tools/pngcmp.cpp b/src/tools/pngcmp.cpp
index 714700a3824..43fc9324a06 100644
--- a/src/tools/pngcmp.cpp
+++ b/src/tools/pngcmp.cpp
@@ -13,7 +13,7 @@
#include <cstring>
#include <cctype>
#include <cassert>
-#include "osdcore.h"
+#include "osdfile.h"
#include "png.h"
#include <new>
diff --git a/src/tools/regrep.cpp b/src/tools/regrep.cpp
index 49637c2eb16..304e195fa10 100644
--- a/src/tools/regrep.cpp
+++ b/src/tools/regrep.cpp
@@ -12,9 +12,13 @@
#include <cctype>
#include <new>
#include <cassert>
-#include "osdcore.h"
+#include "corefile.h"
+#include "corestr.h"
+#include "osdcomm.h"
#include "png.h"
+using util::string_format;
+
/***************************************************************************
CONSTANTS & DEFINES
diff --git a/src/tools/romcmp.cpp b/src/tools/romcmp.cpp
index 95db9a5c200..4862f74a769 100644
--- a/src/tools/romcmp.cpp
+++ b/src/tools/romcmp.cpp
@@ -9,7 +9,7 @@
***************************************************************************/
#include "unzip.h"
-#include "osdcore.h"
+#include "osdfile.h"
#include "osdcomm.h"
#include "hash.h"
diff --git a/src/tools/split.cpp b/src/tools/split.cpp
index 1748edf7625..c3f4489f225 100644
--- a/src/tools/split.cpp
+++ b/src/tools/split.cpp
@@ -149,7 +149,7 @@ static int split_file(const char *filename, const char *basename, uint32_t split
splitfile->printf("hash=%s file=%s.%03d\n", computedhash.c_str(), basefilename.c_str(), partnum);
// compute the full filename for this guy
- outfilename = string_format("%s.%03d", basename, partnum);
+ outfilename = util::string_format("%s.%03d", basename, partnum);
// create it
filerr = util::core_file::open(outfilename, OPEN_FLAG_WRITE | OPEN_FLAG_CREATE, outfile);
diff --git a/src/tools/srcclean.cpp b/src/tools/srcclean.cpp
index 2cf5bf36519..055cce35784 100644
--- a/src/tools/srcclean.cpp
+++ b/src/tools/srcclean.cpp
@@ -51,7 +51,7 @@
#include "corefile.h"
#include "corestr.h"
-#include "osdcore.h"
+#include "osdcomm.h"
#include "strformat.h"
#include <algorithm>
diff --git a/src/tools/unidasm.cpp b/src/tools/unidasm.cpp
index 58f730b1c39..81232078454 100644
--- a/src/tools/unidasm.cpp
+++ b/src/tools/unidasm.cpp
@@ -9,6 +9,7 @@
****************************************************************************/
// the disassemblers assume they're in MAME and emu.h is a PCH, so we minimally pander to them
+#include "coretmpl.h"
#include "disasmintf.h"
using offs_t = osd::u32;