summaryrefslogtreecommitdiffstatshomepage
path: root/src/lib/util/strformat.h
Commit message (Collapse)AuthorAgeFilesLines
* Pacify clang, and more noexcept. Vas Crabb2023-03-261-10/+0
|
* Various optimisations to code generaton. Vas Crabb2023-03-261-725/+216
| | | | | | | | | | | | | | | util/bitmap.cpp, util/palette.cpp: Marked lots of things constexpr. Bitmaps don't throw exceptions on allocation failure, they just become invalid. Almost nothing in MAME actually checks for this. emu/profiler.cpp: Abort if the profile stack overflows rather than throwing an exception. This is a developer feature and if it overflows, the code is broken. Calling a noreturn noexcept function generates less code than throwing an exception, which adds up. util/strformat.cpp: Traded away some unnecessary flexibility for more compact code. The stream objects must derive from std::basic_ostream now - they can't just be any old objects with the expected operators.
* util/strformat.h: Detect C++ standard > C++17 before doing weird stuff. Vas Crabb2021-09-181-10/+16
|
* util/strformat.h, util/delegate.h: More cleanup and future-proofing. Vas Crabb2021-09-181-20/+17
| | | | | | | | | | | * util/strformat.h: Found a SFINAE trick to detect absence of stream-out operators. Fixes building with C++20 standard library (#6275). * util/delegate.h: Fixed a commend and removed an unused declaration from MSVC member function pointer wrapper. * util/delegate.h: Added support for discarding functoid return values for delegates returning void. * util/delegate.h: Added support for using std::ref to bind non-copyable functoids.
* formats, osd, util: Started refactoring file I/O stuff. (#8456) Vas Crabb2021-08-221-27/+27
| | | | | | | | | Added more modern generic I/O interfaces with implementation backed by stdio, osd_file and core_file, replacing io_generic. Also replaced core_file's build-in zlib compression with a filter. unzip.cpp, un7z.cpp: Added option to supply abstract I/O interface rather than filename. Converted osd_file, core_file, archive_file, chd_file and device_image_interface to use std::error_condition rather than their own error enums. Allow mounting TI-99 RPK from inside archives.
* Low-level #include overhaul AJR2021-01-021-2/+0
| | | | | | | - 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.
* Fix some oversights and emergent behaviour with view selection. Vas Crabb2020-12-201-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | Exposed the "native snapview" option on the video manager. Trying to use presence of a single view is a poor proxy that breaks with multi-screen systems. Allow rotation to be changed for native snapshot views, and disable the zoom to screen area control when it has no effect on the selected view. Treat an empty string identically to "auto" for view selectction. Previously this was being used for prefix matching so it would force the first view. (This caused the bad snapshot view selection. It had been relying on "internal" not being a common view name prefix so it fell through to automatic selection, but when changed to an empty string it forced the first view.) Documented "auto" as well as "native" for the -snapview option and changed the default to auto rather than an empty string for consistency with the -viewN options. Added [w]string_view handlers to the stuff that's instantiated in strformat.cpp since we'll be increasingly using them. Cleaned up and updated some documentation.
* More Lua engine clean-up and documentation, resulting in core cleanup. Vas Crabb2020-12-181-61/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More Lua interface cleanup, additional properties and methods, and documentation migration/expansion. Emulated switch inputs can have "not" codes applied to host input axis directions. It works the same way as host switch inputs - push twice for a "not" prefix. Input polling helpers no longer need to store state in the input device items. There’s less leakage, and less chance of things interfering with each other. Allow snapshot view options to be configured through the internal UI via the video options menu. Made video options menus place initial focus on the currently selected view item. Removed some crud from the menu base class. Fixed the description of the "snapview" option. The value to get raw screen pixels was changed to "native" a long time ago but the description was never updated. Re-arranged the Golden Poker button lamps so that the 6-button layouts for Jolli Witch and Wild Witch make sense. In 6-button mode, the hold buttons double as bonus game and bet buttons, but the lamp outputs don't change. The simplest way to deal with this without requiring the user to switch views or using layout scripting is to place the dedicated buttons directly below the hold buttons that correspond to them. Removed some software list data that was redundantly copied into device_image_interface (m_supported was never even set, so it didn't even work), and made crc() work better (previously it wasn't recalculuated after unloading and loading another image). Made strformat.h and devcb.h play nicer with C++17 and pre-standard C++20. Format precision now correctly limits the length of string views. Confirmed that strformat.{h,cpp} works with pre-standard C++20 support in GCC 9. Removed an auto_alloc from cpu/arm7.
* -Switch to building MAME as C++17. Vas Crabb2020-11-151-237/+246
| | | | | | | * Updated sol2 to 3.2.2 * Updated pugixml to 1.10 * Increased minimum clang version to 6 * Cleaned up some stuff that can use new features
* centralise instantiation of more of the util::strformat engine Vas Crabb2020-04-081-0/+533
|
* util/strformat.h: future-proof for C++20 (GitHub #6275) Vas Crabb2020-02-091-31/+54
| | | | | | | (nw) I've triple-checked the code and it looks sane, but I'm still a bit nervous about changing such a fundamental part of MAME. If integer formatting appears to have changed after this, let me know ASAP. Also removed a workaround for older versions of GNU libstdc++ with incomplete C++14 support.
* A round of spelling/typographical fixes to source comments (nw) Scott Stone2016-11-241-5/+5
|
* Reverting this change, it is compiler bug, confirmed by Microsoft VSO#292426 ↵ Miodrag Milanovic2016-11-171-1/+1
| | | | (nw)
* Fix compilation under VS2017 (nw) Miodrag Milanovic2016-11-161-1/+1
| | | | default_semantics is used by apply so need to be public
* While I'm causing full recompiles all the time, reduce necessary number of ↵ Vas Crabb2016-08-271-2/+86
| | | | instantiations of parts of string formatting engine
* Improved workaround for missing cbegin/cend in glibstdc++ [Alex Miller] Vas Crabb2016-06-241-15/+15
|
* Cleanups and version bump Miodrag Milanovic2016-03-301-6/+6
|
* fix for VS builds by Vas (nw) Miodrag Milanovic2016-03-121-1/+1
|
* This depends on libstdc++ version, not GCC version Vas Crabb2016-03-061-1/+1
| | | | | | It's possible to make GCC use older/newer libstdc++ or to use Clang with libstdc++ This is still the wrong place for it - we should have all compiler/library workarounds in one place, not at point of use, to avoid duplication/conflicts
* This works (nw) Miodrag Milanovic2016-03-051-0/+15
|
* Further reduce template instantiations Vas Crabb2016-03-041-16/+16
|
* Reduce number of formatting template instantiations needed - should reduce ↵ Vas Crabb2016-03-041-89/+48
| | | | | | compile time and executable size a bit Small run-time performance penalty shouldn't be a big deal
* Fix for Visual Studio build by Vas (nw) Miodrag Milanovic2016-03-011-1/+1
|
* Add ability to pass argument packs that don't need templates all the way down Vas Crabb2016-03-011-363/+613
|
* * Support *n conversion in stream_format/string_format Vas Crabb2016-03-011-7/+79
| | | | | | | | | * Make stream_format return characters printed * Add iostreams with std::vector storage * Move to type-safe templates for logerror and popmessage * Remove now-unnecessary I64FMT from calls to logerror/popmessage * Put some lib/util stuff in util:: namespace * Some fixes to Japanese translation
* fixed VS build. (nw) dankan18902016-02-281-1/+1
|
* Replace strformat, strprintf and strcatprintf with type-safe steam_format ↵ Vas Crabb2016-02-281-0/+1453
and string_format Update MAME to use new function Instantiate ODR-used static constant members Make some of the UI code more localisable Remove use of retired functions in tools