summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/corefile.cpp
Commit message (Collapse)AuthorAgeFilesLines
* corefile.cpp: Make core_filename_extract_base behave more robustly in ↵ AJR2021-03-051-0/+2
| | | | degenerate cases
* Eliminate ARRAY_LENGTH template in favor of C++17's std::size AJR2021-02-141-4/+4
| | | | | | | | | | * osdcomm.h: Move definition of EQUIVALENT_ARRAY to coretmpl.h * sharc.cpp, gt64xxx.cpp, ym2413.cpp, gb_lcd.cpp, snes_ppu.cpp: Use STRUCT_MEMBER for save state registration * gio/newport.cpp, megadrive/svp.cpp, nes_ctrl/bcbattle.cpp, arm7.cpp, tms9995.cpp, pckeybrd.cpp, sa1110.cpp, sa1111.cpp, jangou_blitter.cpp, vic4567.cpp: Use std::fill(_n) instead of memset * emucore.h: Remove obsolete typedef
* Much more core std::string_view modernization AJR2021-01-201-9/+8
| | | | | | | | | | | | | | | - Remove corestr.h from emu.h; update a few source files to not use it at all - Change strtrimspace, strtrimrightspace and core_filename_extract_* to be pure functions taking a std::string_view by value and returning the same type - Change strmakeupper and strmakelower to be pure functions taking a std::string_view and constructing a std::string - Remove the string-modifying version of zippath_parent - Change tag-based lookup functions in device_t to take std::string_view instead of const std::string & or const char * - Remove the subdevice tag cache from device_t (since device finders are now recommended) and replace it with a map covering directly owned subdevices only - Move the working directory setup method out of device_image_interface (only the UI seems to actually use the full version of this) - Change output_manager to use std::string_view for output name arguments - Change core_options to accept std::string_view for most name and value arguments (return values are still C strings for now) - Change miscellaneous other functions to accept std::string_view arguments - Remove a few string accessor macros from romload.h - Remove many unnecessary c_str() calls from logging/error messages
* Low-level #include overhaul AJR2021-01-021-1/+3
| | | | | | | - 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.
* Further additions of std::string_view AJR2021-01-011-9/+7
| | | | | | | - corefile.cpp, fileio.cpp: Change puts to take a std::string_view parameter - rendlay.cpp: Use std::string_view instead of bare pointers in various functions - vecstream.h: Add std::string_view conversion operator to obtain output buffer without needing to make it a C string with explicit null termination - xmlfile.cpp: Add get_attribute_string_ptr method that distinguishes between empty strings and absent attributes without falling back to C strings
* Revert "fixed some modernize-use-equals-default clang-tidy warnings (… (#6360) Oliver Stöneberg2020-04-081-1/+10
| | | | | | | * Revert "fixed some modernize-use-equals-default clang-tidy warnings (nw)" This reverts commit 54486ab9 * fixed merge error
* there are reasons for things being the way they were (nw) Vas Crabb2020-01-311-0/+9
|
* fixed some modernize-use-auto clang-tidy warnings (nw) (#6238) Oliver Stöneberg2020-01-301-1/+1
|
* fixed some modernize-use-equals-default clang-tidy warnings (nw) (#6237) Oliver Stöneberg2020-01-301-19/+1
|
* fixed some clang-tidy warnings (nw) (#6236) Oliver Stöneberg2020-01-301-1/+1
| | | | | | | | | | | | | | | | * fixed some modernize-redundant-void-arg clang-tidy warnings (nw) * fixed some modernize-use-bool-literals clang-tidy warnings (nw) * fixed some modernize-use-emplace clang-tidy warnings (nw) * fixed some performance-move-const-arg clang-tidy warnings (nw) * fixed some readability-redundant-control-flow clang-tidy warnings (nw) * fixed some readability-redundant-string-cstr clang-tidy warnings (nw) * fixed some performance-unnecessary-value-param clang-tidy warnings (nw)
* use C++ library includes (nw) firewave2020-01-221-1/+1
|
* (nw) Clean up the mess on master Vas Crabb2019-03-261-19/+3
| | | | | | | | | | | | | This effectively reverts b380514764cf857469bae61c11143a19f79a74c5 and c24473ddff715ecec2e258a6eb38960cf8c8e98e, restoring the state at 598cd5227223c3b04ca31f0dbc1981256d9ea3ff. Before pushing, please check that what you're about to push is sane. Check your local commit log and ensure there isn't anything out-of-place before pushing to mainline. When things like this happen, it wastes everyone's time. I really don't need this in a week when real work™ is busting my balls and I'm behind where I want to be with preparing for MAME release.
* Revert "conflict resolution (nw)" andreasnaive2019-03-251-3/+19
| | | | | This reverts commit c24473ddff715ecec2e258a6eb38960cf8c8e98e, reversing changes made to 009cba4fb8102102168ef32870892438327f3705.
* More UI stuff: Vas Crabb2019-01-191-19/+3
| | | | | | | | | * Split up the different parts of ICO loading in the menus (locating files, scaling, drawing, etc.) * Added icon support to software selection menu * Added support for more ICO file variants, including PNG-in-ICO (new DIB parser is overkill for ICO but I can factor it out for BMP loading at some point) * Added favourites filter for software menus - includes software that's favourited on any system, so GBC includes DMG favourties and vice versa * Eliminated unnecessary member variables and O(n) walks in software selection menu * Made the menus' cached texture structures a bit more efficient
* Revert "using of IS_ENABLED in files used in tiny build (nw)" Miodrag Milanovic2016-11-121-1/+1
| | | | This reverts commit 1efccdd38d4bac6ec44e13f0a6cdf877e3a1c7cb.
* using of IS_ENABLED in files used in tiny build (nw) Miodrag Milanovic2016-11-111-1/+1
|
* No need for osd_malloc, osd_malloc_array and osd_free (nw) Miodrag Milanovic2016-11-111-1/+1
| | | | MALLOC_DEBUG not applicable anymore since we use new to allocate in 99.9% of cases
* NOTICE (TYPE NAME CONSOLIDATION) Miodrag Milanovic2016-10-221-2/+2
| | | | | Use standard uint64_t, uint32_t, uint16_t or uint8_t instead of UINT64, UINT32, UINT16 or UINT8 also use standard int64_t, int32_t, int16_t or int8_t instead of INT64, INT32, INT16 or INT8
* use standard types uintptr_t, char16_t and char32_t instead of FPTR, ↵ Miodrag Milanovic2016-10-221-2/+2
| | | | utf16_char, unicode_char (nw)
* dynamic_buffer is just std::vector<UINT8> (nw) Miodrag Milanovic2016-10-211-1/+1
|
* 1. Merge branch 'master' into diimage_filetype_as_stdstring Nathan Woods2016-07-311-3/+1
|\ | | | | | | 2. Introduced is_filetype(), instead of normalizing filetype() to lower case
* | This changes device_image_interface::filetype() to return 'const std::string ↵ Nathan Woods2016-07-311-9/+25
|/ | | | | | | | | | | &' instead of 'const char *'. In the interests of removing burdens from client code, I also changed the following: - filetype() will always return the file extension in lower case - device_image_interface::filetype() will return the correct extension for files loaded as a part of softlists - The code for extracting a file extension is now encapsulated in core_filename_extract_extension() Client code has been updated
* made constexprs lower case and used constexpr for returning input value as ↵ Miodrag Milanovic2016-07-311-2/+2
| | | | well for rest of defines in osdcomm.h (nw)
* Cleanups and version bump Miodrag Milanovic2016-07-271-1/+1
|
* misc fixes (nw) Vas Crabb2016-07-121-4/+5
| | | | | | | | * remove a temporary * fix deps * remove a vestigial member * play nicer with dotfiles * play nicer with pch
* Fixed issue that could cause core_filename_ends_with() to return true when ↵ Nathan Woods2016-07-111-5/+6
| | | | extension.size() > filename.size()
* Adding a check for reverse overflow when extensions is longer than filename Nathan Woods2016-07-111-2/+2
|
* Adopting std::find() and std::find_if() in core_filename_extract_base() Nathan Woods2016-07-111-10/+8
|
* Deeper C++-ification Nathan Woods2016-07-111-8/+12
|
* C++-ification of some corefile static functions Nathan Woods2016-07-101-8/+8
|
* Various cleanups suggested by static analyzer (nw) Miodrag Milanovic2016-04-241-2/+2
|
* * Remove confusing method from vectorstreams that hide base_ios method ↵ Vas Crabb2016-03-181-3/+3
| | | | | | | | | | | | | (fixes disassembly view) * Allow std::string to pass through core_file unmolested (reduces temporary allocations) * Make zip/7z instances of same class with uniform interface * zippath browsing is broken at the moment This is another step towards transparent archive support. It's now possible to access zip and 7z archives with the same code. Nothing is taking advantage of it yet. There's now some very similar code in fileio.cpp and clifront.cpp that could be folded at some point.
* Clear error status on persistent streams Vas Crabb2016-03-171-0/+1
|
* Make osd_file a polymorphic class that's held with smart pointers Vas Crabb2016-03-141-87/+81
| | | | | | | | | | | | | | | Make avi_file a class that's held with smart pointers, encapsulate various AVI I/O structures Make zip_file and _7z_file classes rather than having free functions everywhere Hide zip/7z class implementation behind an interface, no longer need to call close() to send back to the cache Don't dump as much crap in global namespace Add solaris PTY implementation Improve variable expansion for SDL OSD - supports ~/$FOO/${BAR} syntax Rearrange stuff so the same things are in file module for all OSDs Move file stuff into its own module 7z/zip open and destruct are still not thread-safe due to lack of interlocks around cache access Directory functions still need to be moved to file module SDL OSD may not initialise WinSock on Windows
* Allow seek to position 0 in a vectorstream with empty storage, always ↵ Vas Crabb2016-03-101-0/+1
| | | | reserve 1k for core_file printf buffer
* Use type-safe printf for core_file and emu_file, surprisingly few knock-on ↵ Vas Crabb2016-03-091-23/+13
| | | | | | effects Properly fix up a couple of places I64FMT was being used, still more to deal with
* Fix complete failure to read zlib compressed data, handle EOF better in ↵ Vas Crabb2016-03-081-20/+21
| | | | | | compressed files (nw) Fix bug causing crash in pathological case of zero-frame INP file [Vas Crabb]
* Fix loading zipped image Vas Crabb2016-03-071-0/+1
|
* Turn core_file into a proper class that gets cleaned up safely using unique_ptr Vas Crabb2016-03-061-704/+927
| | | | Subverted somewhat by chd_file class
* Add function for flushing file buffers Vas Crabb2016-03-011-0/+10
|
* Return std::string objects by value rather than pass by reference AJR2016-01-101-2/+2
| | | | | | - strprintf is unaltered, but strformat now takes one fewer argument - state_string_export still fills a buffer, but has been made const - get_default_card_software now takes no arguments but returns a string
* macro removal INLINE -> static inline (nw) Miodrag Milanovic2015-12-121-1/+1
|
* clang-modernize part 1 (nw) Miodrag Milanovic2015-12-031-26/+26
|
* Rename *.c -> *.cpp in our source (nw) Miodrag Milanovic2015-11-081-0/+1089