MCPcopy Create free account
hub / github.com/ablab/spades / WindowsError

Class WindowsError

ext/include/cppformat/format.h:2071–2306  ·  view source on GitHub ↗

A Windows error. */

Source from the content-addressed store, hash-verified

2069 A Windows error.
2070*/
2071class WindowsError : public SystemError {
2072 private:
2073 void init(int error_code, StringRef format_str, ArgList args);
2074
2075 public:
2076 /**
2077 \rst
2078 Constructs a :cpp:class:`fmt::WindowsError` object with the description
2079 of the form "*<message>*: *<system-message>*", where *<message>* is the
2080 formatted message and *<system-message>* is the system message corresponding
2081 to the error code.
2082 *error_code* is a Windows error code as given by ``GetLastError``.
2083 \endrst
2084 */
2085 WindowsError(int error_code, StringRef message) {
2086 init(error_code, message, ArgList());
2087 }
2088 FMT_VARIADIC_CTOR(WindowsError, init, int, StringRef)
2089};
2090
2091// Reports a Windows error without throwing an exception.
2092// Can be used to report errors from destructors.
2093void report_windows_error(int error_code, StringRef message) FMT_NOEXCEPT(true);
2094
2095#endif
2096
2097enum Color { BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE };
2098
2099/**
2100 Formats a string and prints it to stdout using ANSI escape sequences
2101 to specify color (experimental).
2102 Example:
2103 PrintColored(fmt::RED, "Elapsed time: {0:.2f} seconds") << 1.23;
2104 */
2105void print_colored(Color c, StringRef format, ArgList args);
2106
2107/**
2108 \rst
2109 Formats arguments and returns the result as a string.
2110
2111 **Example**::
2112
2113 std::string message = format("The answer is {}", 42);
2114 \endrst
2115*/
2116inline std::string format(StringRef format_str, ArgList args) {
2117 MemoryWriter w;
2118 w.write(format_str, args);
2119 return w.str();
2120}
2121
2122inline std::wstring format(WStringRef format_str, ArgList args) {
2123 WMemoryWriter w;
2124 w.write(format_str, args);
2125 return w.str();
2126}
2127
2128/**

Callers 3

sizeMethod · 0.85
UTF8ToUTF16Method · 0.85
UTF16ToUTF8Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected