21#include <log4cxx/log4cxx.h>
90class LOG4CXX_EXPORT
NDC
97 typedef std::stack<DiagnosticContext>
Stack;
111 NDC(
const std::string& message);
183 static bool pop(std::string& buf);
198 static bool peek(std::string& buf);
206 static void push(
const std::string& message);
233#if LOG4CXX_WCHAR_T_API
246 NDC(
const std::wstring& message);
253 static void push(
const std::wstring& message);
259 static bool peek(std::wstring& dst);
265 static bool pop(std::wstring& dst);
267#if LOG4CXX_UNICHAR_API
280 NDC(
const std::basic_string<UniChar>& message);
287 static void push(
const std::basic_string<UniChar>& message);
293 static bool peek(std::basic_string<UniChar>& dst);
299 static bool pop(std::basic_string<UniChar>& dst);
301#if LOG4CXX_CFSTRING_API
338 NDC& operator=(
const NDC&);
the ndc class implements nested diagnostic contexts as defined by neil harrison in the article "patte...
Definition: ndc.h:91
static void pushLS(const LogString &message)
Push new diagnostic context information for the current thread.
NDC(const std::basic_string< UniChar > &message)
Creates a nested diagnostic context.
std::stack< DiagnosticContext > Stack
Definition: ndc.h:97
static void push(const std::basic_string< UniChar > &message)
Push new diagnostic context information for the current thread.
static void push(const CFStringRef &message)
Push new diagnostic context information for the current thread.
~NDC()
Removes the topmost element from the NDC stack.
static bool pop(CFStringRef &dst)
Gets and removes the current NDC value.
static LogString pop()
Pop top value off stack.
static Stack * cloneStack()
Clone the diagnostic context for the current thread.
static void push(const std::string &message)
Push new diagnostic context information for the current thread.
std::pair< LogString, LogString > DiagnosticContext
Pair of Message and FullMessage.
Definition: ndc.h:96
static bool pop(std::string &buf)
Pop top value off stack.
static void clear()
Clear any nested diagnostic information if any.
static bool peek(std::basic_string< UniChar > &dst)
Appends the current NDC content to the provided string.
static void inherit(Stack *stack)
Inherit the diagnostic context of another thread.
static void push(const std::wstring &message)
Push new diagnostic context information for the current thread.
static bool empty()
Tests if the NDC is empty.
NDC(const CFStringRef &message)
Creates a nested diagnostic context.
static bool pop(std::wstring &dst)
Appends the current NDC content to the provided string and removes the value from the NDC.
static void remove()
Remove the diagnostic context for this thread.
static int getDepth()
Get the current nesting depth of this diagnostic context.
NDC(const std::string &message)
Creates a nested diagnostic context.
static bool peek(CFStringRef &dst)
Gets the current NDC value.
static LogString peek()
Looks at the last diagnostic context at the top of this NDC without removing it.
static bool pop(std::basic_string< UniChar > &dst)
Appends the current NDC content to the provided string and removes the value from the NDC.
static bool get(LogString &dest)
Get the current value of the NDC of the currrent thread.
static bool peek(std::wstring &dst)
Appends the current NDC content to the provided string.
static bool peek(std::string &buf)
Get top value without removing value.
NDC(const std::wstring &message)
Creates a nested diagnostic context.
const struct __CFString * CFStringRef
Definition: logstring.h:30
Definition: configuration.h:25
std::basic_string< logchar > LogString
Definition: logstring.h:60