etc... -> etc.

This commit is contained in:
Alexander Shaduri
2024-04-25 16:53:30 +04:00
parent 02bdf755a3
commit 589263e902
36 changed files with 66 additions and 66 deletions
+1 -1
View File
@@ -25,4 +25,4 @@ Steps to reproduce the behavior:
[If applicable, add screenshots to help explain your problem].
**Additional Context**
[Add any other context about the problem here (GTK+ version, etc...)]
[Add any other context about the problem here (GTK+ version, etc.)]
+1 -1
View File
@@ -20,7 +20,7 @@ project(gsmartcontrol
)
# Provide DATADIR, etc...
# Provide DATADIR, etc.
include(GNUInstallDirs)
message(STATUS "Using toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
+1 -1
View File
@@ -113,7 +113,7 @@ Version 0.8.6, released on 2011-06-12
included.
In-program help has been expanded considerably.
General improvements to user interface have been implemented (better GNOME
HIG compliance, better tooltips, dialogs, etc...).
HIG compliance, better tooltips, dialogs, etc.).
Added ability to show smartctl output for devices whose info could not be
parsed fully.
Attributes in "brief" format are supported now.
+1 -1
View File
@@ -33,7 +33,7 @@ all the available packages of GSmartControl.
- allows enabling/disabling SMART;
- supports configuration of global and per-drive options for smartctl;
- performs SMART self-tests;
- displays drive identity information, capabilities, attributes, device statistics, etc...;
- displays drive identity information, capabilities, attributes, device statistics, etc.;
- can read in smartctl output from a saved file, interpreting it as a read-only virtual device;
- works on most smartctl-supported operating systems;
- has extensive help information.
+1 -1
View File
@@ -32,7 +32,7 @@ all the available packages of GSmartControl.
- allows enabling/disabling SMART;
- supports configuration of global and per-drive options for smartctl;
- performs SMART self-tests;
- displays drive identity information, capabilities, attributes, device statistics, etc...;
- displays drive identity information, capabilities, attributes, device statistics, etc.;
- can read in smartctl output from a saved file, interpreting it as a read-only virtual device;
- works on most smartctl-supported operating systems;
- has extensive help information.
+1 -1
View File
@@ -25,7 +25,7 @@ emulator (as `root`, using `sudo` or `su`):
smartctl -x /dev/sda
```
**Note:** If using Windows, the device name should be `/dev/pd1` for the
second physical drive, etc... Run `cmd` as administrator first.
second physical drive, etc. Run `cmd` as administrator first.
If you still think it's a GSmartControl issue, please collect the following
information about your system:
+2 -2
View File
@@ -15,7 +15,7 @@ and drives behind some RAID controllers are supported for now.
The main reasons for this are:
- We can't support drives which don't work with smartmontools.
This affects drives which don't support SMART or don't export SMART data
correctly (e.g. some USB enclosures, RAIDs, etc...).
correctly (e.g. some USB enclosures, RAIDs, etc.).
- Smartctl's output for SCSI drives is completely different compared to ATA.
Also, SCSI drives are rarely found in desktop systems and the servers rarely
have X11 / Gtkmm running, so this is a low priority task.
@@ -47,7 +47,7 @@ hardware to users with non-administrative privileges.
In Windows, UAC is automatically invoked when you run it. In Linux / Unix operating
systems, running `gsmartcontrol-root` (or using the desktop icon) will
automatically launch GSmartControl using the system's preferred su
mechanism - `PolKit`, `kdesu`, `gnomesu`, etc...
mechanism - `PolKit`, `kdesu`, `gnomesu`, etc.
Please **do not** set the `setuid` flag on smartctl binary. It is considered
a security risk.
+1 -1
View File
@@ -49,7 +49,7 @@ class AsyncCommandExecutor : public hz::ErrorHolder {
/// Destructor. Don't destroy this object unless the child has exited. It will leak stuff
/// and possibly crash, etc... .
/// and possibly crash, etc. .
~AsyncCommandExecutor() override;
+4 -4
View File
@@ -152,7 +152,7 @@ class AtaStorageErrorBlock {
uint32_t error_num = 0; ///< Error number
uint64_t log_index = 0; ///< Log index
uint32_t lifetime_hours = 0; ///< When the error occurred (in lifetime hours)
std::string device_state; ///< Device state during the error - "active or idle", standby, etc...
std::string device_state; ///< Device state during the error - "active or idle", standby, etc.
std::vector<std::string> reported_types; ///< Array of reported types (strings), e.g. "UNC".
std::string type_more_info; ///< More info on error type (e.g. "at LBA = 0x0253eac0 = 39054016")
uint64_t lba = 0; ///< LBA of the error
@@ -210,8 +210,8 @@ class AtaStorageSelftestEntry {
uint32_t test_num = 0; ///< Test number. always starts from 1. larger means older or newer, depending on model. 0 for capability.
std::string type; ///< Extended offline, Short offline, Conveyance offline, etc... . capability: unused.
std::string status_str; ///< Self-test routine in progress, Completed without error, etc... (as reported by log or capability)
std::string type; ///< Extended offline, Short offline, Conveyance offline, etc. . capability: unused.
std::string status_str; ///< Self-test routine in progress, Completed without error, etc. (as reported by log or capability)
Status status = Status::Unknown; ///< same as status_str, but from enum
int8_t remaining_percent = -1; ///< Remaining %. 0% for completed, 90% for started. -1 if n/a.
uint32_t lifetime_hours = 0; ///< When the test happened (in lifetime hours). capability: unused.
@@ -317,7 +317,7 @@ class AtaStorageProperty {
std::string generic_name; ///< Generic (internal) name. May be same as reported_name, or something more program-identifiable.
std::string displayable_name; ///< Readable property name. May be same as reported_name, or something more user-readable. Possibly translatable.
std::string description; ///< Property description (for tooltips, etc...). May contain markup.
std::string description; ///< Property description (for tooltips, etc.). May contain markup.
Section section = Section::Unknown; ///< Section this property belongs to
+1 -1
View File
@@ -1633,7 +1633,7 @@ bool ata_storage_property_autoset_description(AtaStorageProperty& p, AtaStorageA
case AtaStorageProperty::Section::ErrorLog:
found = auto_set(p, "ata_smart_error_log/extended/revision", p.displayable_name.c_str())
|| auto_set(p, "ata_smart_error_log/extended/count", "Number of errors in error log. Note: Some manufacturers may list completely harmless errors in this log "
"(e.g., command invalid, not implemented, etc...).");
"(e.g., command invalid, not implemented, etc.).");
// || auto_set(p, "error_log_unsupported", "This device does not support error logging."); // the property text already says that
if (p.is_value_type<AtaStorageErrorBlock>()) {
for (size_t i = 0; i < p.get_value<AtaStorageErrorBlock>().reported_types.size(); ++i) {
+1 -1
View File
@@ -18,7 +18,7 @@ Copyright:
class StoragePropertyProcessor {
public:
/// Set descriptions, warnings, etc... on properties, and return them.
/// Set descriptions, warnings, etc. on properties, and return them.
static StoragePropertyRepository process_properties(StoragePropertyRepository properties,
AtaStorageAttribute::DiskType disk_type);
+1 -1
View File
@@ -209,7 +209,7 @@ class CommandExecutor : public sigc::trackable {
std::string command_name_; ///< Command name
std::string command_args_; ///< Command arguments
std::string running_msg_; ///< "Running" message (to show in the dialogs, etc...)
std::string running_msg_; ///< "Running" message (to show in the dialogs, etc.)
std::chrono::milliseconds forced_kill_timeout_msec_ = std::chrono::seconds(3); // 3 sec by default. Kill timeout in ms.
+1 -1
View File
@@ -21,7 +21,7 @@ Copyright:
/// Same as CommandExecutor, but with GTK UI support.
/// This one is noncopyable, because we can't copy the dialogs, etc...
/// This one is noncopyable, because we can't copy the dialogs, etc.
class CommandExecutorGui : public CommandExecutor {
public:
@@ -24,7 +24,7 @@ int main()
{
return hz::main_exception_wrapper([]()
{
// These settings contain device search paths, smartctl binary, etc...
// These settings contain device search paths, smartctl binary, etc.
init_default_settings();
std::vector<StorageDevicePtr> drives;
+2 -2
View File
@@ -121,7 +121,7 @@ hz::ExpectedVoid<SelfTestError> SelfTest::start(const std::shared_ptr<CommandExe
return hz::Unexpected(SelfTestError::AlreadyRunning, _("A test is already running on this drive."));
}
if (!this->is_supported()) {
// Translators: {} is a test name - Short test, etc...
// Translators: {} is a test name - Short test, etc.
return hz::Unexpected(SelfTestError::UnsupportedTest,
std::vformat(_("{} is unsupported by this drive."), std::make_format_args(get_test_displayable_name(type_))));
}
@@ -306,7 +306,7 @@ hz::ExpectedVoid<SelfTestError> SelfTest::update(const std::shared_ptr<CommandEx
// seconds per 10%. use double, because e.g. 60sec test gives silly values with int.
const double gran = (double(total.count()) / 9.);
// Add 1/10 for disk load delays, etc... . Limit to 15sec, in case of very quick tests.
// Add 1/10 for disk load delays, etc. . Limit to 15sec, in case of very quick tests.
poll_in_seconds_ = std::chrono::seconds(std::max(int64_t(15), int64_t(gran / 3. + (gran / 10.))));
// for long tests we don't want to make the user wait too much, so
+1 -1
View File
@@ -164,7 +164,7 @@ using SmartctlExecutor = SmartctlExecutorGeneric<CommandExecutor>;
/// Get smartctl binary (from config, etc...). Returns an empty string if not found.
/// Get smartctl binary (from config, etc.). Returns an empty string if not found.
[[nodiscard]] hz::fs::path get_smartctl_binary();
+3 -3
View File
@@ -295,7 +295,7 @@ hz::ExpectedVoid<SmartctlParserError> SmartctlTextAtaParser::parse_section(const
return {};
}
// This is printed when executing "-t long", etc... . Parsed by respective command issuer.
// This is printed when executing "-t long", etc. . Parsed by respective command issuer.
if (app_pcre_match("/START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION/mi", header)) {
return {};
}
@@ -999,7 +999,7 @@ hz::ExpectedVoid<SmartctlParserError> SmartctlTextAtaParser::parse_section_data_
// because we look for immediate/automatic anyway.
// "was never started", "was completed without error", "is in progress",
// "was suspended by an interrupting command from host", etc...
// "was suspended by an interrupting command from host", etc.
const pcrecpp::RE re_offline_status = app_pcre_re("/^(Off-?line data collection) activity (?:is|was) (.*)$/mi");
// "Enabled", "Disabled". May not show up on older smartctl (< 5.1.10), so no way of knowing there.
const pcrecpp::RE re_offline_enabled = app_pcre_re("/^(Auto Off-?line Data Collection):[ \\t]*(.*)$/mi");
@@ -2193,7 +2193,7 @@ Page Offset Size Value Description
continue; // we don't need this line
}
if (re_flag_descr.PartialMatch(line)) { // " |||_ C monitored condition met", etc...
if (re_flag_descr.PartialMatch(line)) { // " |||_ C monitored condition met", etc.
continue; // skip flag description lines
}
+3 -3
View File
@@ -43,8 +43,8 @@ hz::ExpectedVoid<StorageDetectorError> StorageDetector::detect(std::vector<Stora
} else if constexpr(BuildEnv::is_kernel_family_windows()) {
detect_status = detect_drives_win32(all_detected, ex_factory); // win32
} else { // freebsd, etc...
detect_status = detect_drives_other(all_detected, ex_factory); // bsd, etc... . scans /dev.
} else { // freebsd, etc.
detect_status = detect_drives_other(all_detected, ex_factory); // bsd, etc. . scans /dev.
}
if (all_detected.empty()) {
@@ -112,7 +112,7 @@ hz::ExpectedVoid<StorageDetectorError> StorageDetector::fetch_basic_data(std::ve
fetch_status = drive->fetch_basic_data_and_parse(smartctl_ex);
}
// normally we skip drives with errors - possibly scsi, etc...
// normally we skip drives with errors - possibly scsi, etc.
if (return_first_error && !fetch_status) {
return hz::Unexpected(StorageDetectorError::StorageDeviceError, fetch_status.error().message());
}
+1 -1
View File
@@ -871,7 +871,7 @@ Call as: smartctl -a -d cciss,[0-127] /dev/cciss/c0d0
To detect controller presence: cat /proc/devices, contains "cciss0"
for controller 0.
/proc/scsi/scsi contains no entries for it.
/dev/cciss/c0d0p1 is the first ordinary partition (used in mount, etc...).
/dev/cciss/c0d0p1 is the first ordinary partition (used in mount, etc.).
The port limit had a brief regression in 5.39.x (limited to 15).
5.39 doesn't seem to work at all (prereleases work with P400 controller)?
+3 -3
View File
@@ -156,7 +156,7 @@ hz::ExpectedVoid<StorageDetectorError> detect_drives_other(std::vector<StorageDe
} else if constexpr(BuildEnv::is_kernel_darwin()) {
// Darwin has /dev/disk0, /dev/disk0s1, etc...
// Darwin has /dev/disk0, /dev/disk0s1, etc.
// Only real devices are present, so no need for additional checks.
whitelist = {
@@ -193,7 +193,7 @@ hz::ExpectedVoid<StorageDetectorError> detect_drives_other(std::vector<StorageDe
continue;
// In case these are links, check if the originals exists (solaris has dangling links, filter them out).
// We don't replace /dev files with real devices - it leads to really bad paths (pci ids for solaris, etc...).
// We don't replace /dev files with real devices - it leads to really bad paths (pci ids for solaris, etc.).
if (!hz::fs::exists(path)) {
continue;
}
@@ -211,7 +211,7 @@ hz::ExpectedVoid<StorageDetectorError> detect_drives_other(std::vector<StorageDe
|| BuildEnv::is_kernel_openbsd() || BuildEnv::is_kernel_netbsd()) {
// Since we may have encountered dummy devices, we should check
// if they really exist. Unfortunately, this involves opening them, which
// is not good with some media (e.g. it may hang on audio cd (freebsd, maybe others), etc...).
// is not good with some media (e.g. it may hang on audio cd (freebsd, maybe others), etc.).
// That's why we don't whitelist cd devices. Let's hope usb and others are
// ok with this. Dummy devices give errno ENXIO (6, Device not configured) on *bsd.
// In Linux ENXIO is (6, No such device or address).
+1 -1
View File
@@ -22,7 +22,7 @@ Copyright:
#include "storage_detector.h"
/// Detect drives in FreeBSD, Solaris, etc... (all except Linux and Windows).
/// Detect drives in FreeBSD, Solaris, etc. (all except Linux and Windows).
[[nodiscard]] hz::ExpectedVoid<StorageDetectorError> detect_drives_other(std::vector<StorageDevicePtr>& drives,
const CommandExecutorFactoryPtr& ex_factory);
+1 -1
View File
@@ -19,7 +19,7 @@ Copyright:
#include <memory>
#ifdef _WIN32
#include <windows.h> // CreateFileA(), CloseHandle(), etc...
#include <windows.h> // CreateFileA(), CloseHandle(), etc.
#endif
#include "hz/win32_tools.h"
+11 -11
View File
@@ -31,10 +31,10 @@ Copyright:
std::string StorageDevice::get_type_storable_name(DetectedType type)
{
static const std::unordered_map<DetectedType, std::string> m {
{DetectedType::Unknown, "unknown"},
{DetectedType::Invalid, "invalid"},
{DetectedType::CdDvd, "cd/dvd"},
{DetectedType::Raid, "raid"},
{DetectedType::Unknown, "unknown"},
{DetectedType::NeedsExplicitType, "invalid"},
{DetectedType::CdDvd, "cd/dvd"},
{DetectedType::Raid, "raid"},
};
if (auto iter = m.find(type); iter != m.end()) {
return iter->second;
@@ -110,7 +110,7 @@ hz::ExpectedVoid<StorageDeviceError> StorageDevice::fetch_basic_data_and_parse(
this->clear_fetched(); // clear everything fetched before, including outputs
// We don't use "--all" - it may cause really screwed up the output (tests, etc...).
// We don't use "--all" - it may cause really screwed up the output (tests, etc.).
// This looks just like "--info" only on non-smart devices.
const auto default_parser_type = SmartctlVersionParser::get_default_format(SmartctlParserType::Basic);
std::string command_options = "--info --health --capabilities";
@@ -123,10 +123,10 @@ hz::ExpectedVoid<StorageDeviceError> StorageDevice::fetch_basic_data_and_parse(
// Smartctl 5.39 cvs/svn version defaults to usb type on at least linux and windows.
// This means that the old SCSI identify command isn't executed by default,
// and there is no information about the device manufacturer/etc... in the output.
// and there is no information about the device manufacturer/etc. in the output.
// We detect this and set the device type to scsi to at least have _some_ info.
if ((execute_status || execute_status.error().data() == StorageDeviceError::ExecutionError)
&& get_detected_type() == DetectedType::Invalid && get_type_argument().empty()) {
&& get_detected_type() == DetectedType::NeedsExplicitType && get_type_argument().empty()) {
debug_out_info("app", "The device seems to be of different type than auto-detected, trying again with scsi.\n");
this->set_type_argument("scsi");
return this->fetch_basic_data_and_parse(smartctl_ex); // try again with scsi
@@ -141,7 +141,7 @@ hz::ExpectedVoid<StorageDeviceError> StorageDevice::fetch_basic_data_and_parse(
// return execute_status;
// }
// Set some properties too - they are needed for e.g. AODC status, etc...
// Set some properties too - they are needed for e.g. AODC status, etc.
return this->parse_basic_data(true);
}
@@ -277,7 +277,7 @@ hz::ExpectedVoid<StorageDeviceError> StorageDevice::fetch_full_data_and_parse(
// See notes above (in fetch_basic_data_and_parse()).
if ((execute_status || execute_status.error().data() == StorageDeviceError::ExecutionError)
&& get_detected_type() == DetectedType::Invalid && get_type_argument().empty()) {
&& get_detected_type() == DetectedType::NeedsExplicitType && get_type_argument().empty()) {
debug_out_info("app", "The device seems to be of different type than auto-detected, trying again with scsi.\n");
this->set_type_argument("scsi");
return this->fetch_full_data_and_parse(smartctl_ex); // try again with scsi
@@ -834,11 +834,11 @@ hz::ExpectedVoid<StorageDeviceError> StorageDevice::execute_device_smartctl(cons
// Smartctl 5.39 cvs/svn version defaults to usb type on at least linux and windows.
// This means that the old SCSI identify command isn't executed by default,
// and there is no information about the device manufacturer/etc... in the output.
// and there is no information about the device manufacturer/etc. in the output.
// We detect this and set the device type to scsi to at least have _some_ info.
if (check_type && this->get_detected_type() == DetectedType::Unknown
&& app_pcre_match("/specify device type with the -d option/mi", smartctl_output)) {
this->set_detected_type(DetectedType::Invalid);
this->set_detected_type(DetectedType::NeedsExplicitType);
}
return hz::Unexpected(StorageDeviceError::ExecutionError, smartctl_status.error().message());
+1 -1
View File
@@ -288,7 +288,7 @@ class StorageDevice {
std::optional<std::string> family_name_; ///< Family name
std::optional<std::string> serial_number_; ///< Serial number
std::optional<std::string> size_; ///< Formatted size
std::optional<bool> hdd_; ///< Whether it's a rotational drive (HDD) or something else (SSD, flash, etc...)
std::optional<bool> hdd_; ///< Whether it's a rotational drive (HDD) or something else (SSD, flash, etc.)
mutable std::optional<AtaStorageProperty> health_property_; ///< Cached health property.
StoragePropertyRepository property_repository_; ///< Parsed data properties
+1 -1
View File
@@ -92,7 +92,7 @@ endif()
# Other mingw defines include: __WINNT, __WINNT__, __WIN32__, __i386, _X86_,
# i386, __i386__, WIN32, __MINGW32__, WINNT (all equal to 1).
# Windows 64: mingw64 defines the same stuff as 32-bit one, plus _WIN64, __MINGW64__, etc... .
# Windows 64: mingw64 defines the same stuff as 32-bit one, plus _WIN64, __MINGW64__, etc. .
# Keep in mind that if you're generating a 32-bit application, the kernel will
# be windows32 even if you run it on 64-bit Windows.
+1 -1
View File
@@ -51,7 +51,7 @@ endif()
# Mingw: This enables standards-compliant stdio behaviour (regarding printf and
# friends), as opposed to msvc-compatible one. This is usually enabled
# by default if one of the usual macros are encountered (_XOPEN_SOURCE,
# _GNU_SOURCE, etc...).
# _GNU_SOURCE, etc.).
# See _mingw.h for details.
if (WIN32)
# No effect in MSVC, doesn't hurt.
+1 -1
View File
@@ -1960,7 +1960,7 @@ gboolean GscInfoWindow::test_idle_callback(void* data)
// One update() is performed by start(), so do the timeout first.
// Wait until next poll (up to several minutes). Meanwhile, interpolate
// the remaining time, update the progressbar, etc...
// the remaining time, update the progressbar, etc.
if (self->test_timer_poll.elapsed() < static_cast<double>(poll_in.count())) { // elapsed() is seconds in double.
// Update progress bar right after poll, plus every 5 seconds.
+1 -1
View File
@@ -30,7 +30,7 @@ Copyright:
#include <versionhelpers.h>
#endif
#include "libdebug/libdebug.h" // include full libdebug here (to add domains, etc...)
#include "libdebug/libdebug.h" // include full libdebug here (to add domains, etc.)
#include "rconfig/rconfig.h"
#include "rconfig/loadsave.h"
#include "rconfig/autosave.h"
+3 -3
View File
@@ -203,7 +203,7 @@ void GscMainWindow::populate_iconview(bool smartctl_valid)
}
}
// update the menus (group sensitiveness, etc...)
// update the menus (group sensitiveness, etc.)
iconview_->update_menu_actions();
this->update_status_widgets();
}
@@ -806,7 +806,7 @@ Gtk::Menu* GscMainWindow::get_popup_menu(const StorageDevicePtr& drive)
void GscMainWindow::set_drive_menu_status(const StorageDevicePtr& drive)
{
// disable any action handling until we're out of here, else we'll get some
// bogus toggle actions, etc...
// bogus toggle actions, etc.
this->action_handling_enabled_ = false;
do { // for quick skipping
@@ -987,7 +987,7 @@ void GscMainWindow::rescan_devices()
return;
// don't manipulate window sensitiveness here - it breaks things
// (cursors, gtk errors pop out, etc...)
// (cursors, gtk errors pop out, etc.)
// if at least one drive is having a test performed, disallow.
if (this->testing_active()) {
+1 -1
View File
@@ -104,7 +104,7 @@ class GscMainWindow : public AppBuilderWidget<GscMainWindow, false> {
/// Get popup menu for a drive
[[nodiscard]] Gtk::Menu* get_popup_menu(const StorageDevicePtr& drive);
/// Update status widgets (status area, etc...)
/// Update status widgets (status area, etc.)
void update_status_widgets();
+4 -4
View File
@@ -260,7 +260,7 @@ class GscMainWindowIconView : public Gtk::IconView {
/// Decorate a drive entry (colorize it if it has errors, etc...).
/// Decorate a drive entry (colorize it if it has errors, etc.).
/// This should be called to update the icon of already refreshed drive.
void decorate_entry(const Gtk::TreePath& model_path)
{
@@ -273,7 +273,7 @@ class GscMainWindowIconView : public Gtk::IconView {
/// Decorate a drive entry (colorize it if it has errors, etc...).
/// Decorate a drive entry (colorize it if it has errors, etc.).
/// This should be called to update the icon of already refreshed drive.
void decorate_entry(Gtk::TreeModel::Row& row)
{
@@ -351,7 +351,7 @@ class GscMainWindowIconView : public Gtk::IconView {
icon = cddvd_icon;
break;
case StorageDevice::DetectedType::Unknown: // standard HD icon
case StorageDevice::DetectedType::Invalid:
case StorageDevice::DetectedType::NeedsExplicitType:
case StorageDevice::DetectedType::Raid: // TODO a separate icon for this
icon = hd_icon;
break;
@@ -511,7 +511,7 @@ class GscMainWindowIconView : public Gtk::IconView {
// properly before that.
this->update_menu_actions();
main_window->update_status_widgets(); // status area, etc...
main_window->update_status_widgets(); // status area, etc.
}
+1 -1
View File
@@ -56,7 +56,7 @@ namespace hz {
/// Format byte or bit size in human-readable way, e.g. KB, mb, etc...
/// Format byte or bit size in human-readable way, e.g. KB, mb, etc.
/// Note that kilobit always means 1000 bits, there's no confusion with that (as opposed to kilobyte).
/// This function honors the SI rules, e.g. GiB for binary, GB for decimal (as defined by SI).
inline std::string format_size(uint64_t size, bool use_decimal = false, bool size_is_bits = false)
+1 -1
View File
@@ -395,7 +395,7 @@ inline fs::path fs_get_home_dir()
return fs_path_from_string(dir);
#else // linux, etc...
#else // linux, etc.
// We use $HOME to allow the user to override it.
// Other solutions involve getpwuid_r() to read from passwd.
std::string dir;
+4 -4
View File
@@ -488,7 +488,7 @@ inline std::string string_replace_copy(const std::string& s,
/// Replace from_chars[0] with to_chars[0], from_chars[1] with to_chars[1], etc... in s (modifying s).
/// Replace from_chars[0] with to_chars[0], from_chars[1] with to_chars[1], etc. in s (modifying s).
/// from_chars.size() must be equal to to_chars.size().
/// Note: This is a multi-pass algorithm (there are from_chars.size() iterations).
inline std::string::size_type string_replace_chars(std::string& s,
@@ -519,7 +519,7 @@ inline std::string::size_type string_replace_chars(std::string& s,
}
/// Replace from_chars[0] with to_chars[0], from_chars[1] with to_chars[1], etc... in s,
/// Replace from_chars[0] with to_chars[0], from_chars[1] with to_chars[1], etc. in s,
/// not modifying s, returning the changed string.
/// from_chars.size() must be equal to to_chars.size().
/// Note: This is a multi-pass algorithm (there are from_chars.size() iterations).
@@ -569,7 +569,7 @@ inline std::string string_replace_chars_copy(const std::string& s,
/// Replace from_strings[0] with to_strings[0], from_strings[1] with to_strings[1], etc...
/// Replace from_strings[0] with to_strings[0], from_strings[1] with to_strings[1], etc.
/// in s (modifying s). Returns total number of replacements performed.
/// from_strings.size() must be equal to to_strings.size().
/// Note: This is a multi-pass algorithm (there are from_strings.size() iterations).
@@ -607,7 +607,7 @@ std::string::size_type string_replace_array(std::string& s,
}
/// Eeplace from_strings[0] with to_strings[0], from_strings[1] with to_strings[1], etc... in s,
/// Eeplace from_strings[0] with to_strings[0], from_strings[1] with to_strings[1], etc. in s,
/// not modifying s, returning the changed string.
/// from_strings.size() must be equal to to_strings.size().
/// Note: This is a multi-pass algorithm (there are from_strings.size() iterations).
+1 -1
View File
@@ -49,7 +49,7 @@ Copyright:
\note If using mingw runtime >= 3.15 and __USE_MINGW_ANSI_STDIO,
mingw supports both C99/POSIX and msvcrt format specifiers.
This includes proper printing of long double, %lld and %llu, etc...
This includes proper printing of long double, %lld and %llu, etc.
This does _not_ affect _snprintf() and similar non-standard functions.
Note that you may still get warnings from gcc regarding non-MS
format specifiers (see HZ_FUNC_PRINTF_CHECK).
+2 -2
View File
@@ -18,7 +18,7 @@ Copyright:
/// Debug level enum and related functions
namespace debug_level {
enum flag : std::size_t { ///< Debug level (seriousness).
dump, ///< Dump level (structure dumps, additional verbosity, etc...)
dump, ///< Dump level (structure dumps, additional verbosity, etc.)
info, ///< Information level (what the application is doing)
warn, ///< Warning level (simple warnings)
error, ///< Error level (recoverable errors)
@@ -81,7 +81,7 @@ namespace debug_format {
namespace debug_pos {
enum flag : std::size_t { ///< Position output flags
func_name, ///< Print function name (only)
func, ///< Print function name with namespaces, etc... (off by default).
func, ///< Print function name with namespaces, etc. (off by default).
line, ///< Print source code line
file, ///< Print file path and name
// def = func_name | line | file, ///< Default flags