ReactOS 0.4.15-dev-5667-ged97270
string_error Class Reference

#include <shellext.h>

Inheritance diagram for string_error:
Collaboration diagram for string_error:

Public Member Functions

 string_error (int resno,...)
 
const charwhat () const noexcept
 

Private Attributes

string msg
 

Additional Inherited Members

- Public Attributes inherited from __exception
vtable_ptrvtable
 
charname
 
int do_free
 
const vtable_ptrvtable
 
BOOL do_free
 

Detailed Description

Definition at line 352 of file shellext.h.

Constructor & Destructor Documentation

◆ string_error()

string_error::string_error ( int  resno,
  ... 
)

Definition at line 707 of file main.cpp.

707 {
708 wstring fmt, s;
709 int len;
711
712 if (!load_string(module, resno, fmt))
713 throw runtime_error("LoadString failed."); // FIXME
714
715 va_start(args, resno);
716 len = _vsnwprintf(nullptr, 0, fmt.c_str(), args);
717
718 if (len == 0)
719 s = L"";
720 else {
721 s.resize(len);
722 _vsnwprintf((wchar_t*)s.c_str(), len, fmt.c_str(), args);
723 }
724
725 va_end(args);
726
728}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
string msg
Definition: shellext.h:361
static string utf16_to_utf8(const wstring_view &utf16)
Definition: main.cpp:670
GLdouble s
Definition: gl.h:2039
GLenum GLsizei len
Definition: glext.h:6722
_CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest, size_t _Count, const wchar_t *_Format, va_list _Args)
#define L(x)
Definition: ntvdm.h:50
bool load_string(HMODULE module, UINT id, wstring &s)
Definition: main.cpp:206
Definition: match.c:390
Definition: dsound.c:943

Member Function Documentation

◆ what()

const char * string_error::what ( ) const
inlinenoexcept

Definition at line 356 of file shellext.h.

356 {
357 return msg.c_str();
358 }

Member Data Documentation

◆ msg

string string_error::msg
private

Definition at line 361 of file shellext.h.

Referenced by string_error(), and what().


The documentation for this class was generated from the following files: