AzerothCore 3.3.5a
OpenSource WoW Emulator
Loading...
Searching...
No Matches
Acore::ACLogSink< T > Class Template Reference

Public Types

typedef char char_type
 
typedef sink_tag category
 

Public Member Functions

 ACLogSink (T callback)
 
std::streamsize write (char const *str, std::streamsize size)
 

Private Attributes

callback_
 

Detailed Description

template<typename T>
class Acore::ACLogSink< T >

Member Typedef Documentation

◆ category

template<typename T >
typedef sink_tag Acore::ACLogSink< T >::category

◆ char_type

template<typename T >
typedef char Acore::ACLogSink< T >::char_type

Constructor & Destructor Documentation

◆ ACLogSink()

template<typename T >
Acore::ACLogSink< T >::ACLogSink ( callback)
inline
44 : callback_(std::move(callback)) { }
T callback_
Definition: StartProcess.cpp:36

Member Function Documentation

◆ write()

template<typename T >
std::streamsize Acore::ACLogSink< T >::write ( char const *  str,
std::streamsize  size 
)
inline
47 {
48 std::string consoleStr(str, size);
49 std::string utf8;
50 if (consoleToUtf8(consoleStr, utf8))
51 callback_(utf8);
52 return size;
53 }
bool consoleToUtf8(std::string_view conStr, std::string &utf8str)
Definition: Util.cpp:466

References Acore::ACLogSink< T >::callback_, and consoleToUtf8().

Member Data Documentation

◆ callback_

template<typename T >
T Acore::ACLogSink< T >::callback_
private