CDumpContext::operator <<

输出为转储上下文的指定数据。

CDumpContext& operator <<( 
   const CObject* pOb  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   const CObject& ob  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   LPCTSTR lpsz  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   const void* lp  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   BYTE by  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   WORD w  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   DWORD dw  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   int n  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   double d  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   float f  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   LONG l  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   UINT u  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   LPCWSTR lpsz  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   LPCSTR lpsz  
); 
throw( 
   CFileException*  
); 
CDumpContext& operator <<( 
   LONGLONG n  
); 
CDumpContext& operator <<( 
   ULONGLONG n  
); 
CDumpContext& operator <<( 
   HWND h 
); 
CDumpContext& operator <<( 
HDC h 
); 
CDumpContext& operator <<( 
HMENU h 
); 
CDumpContext& operator <<( 
HACCEL h 
); 
CDumpContext& operator <<( 
HFONT h 
);

返回值

CDumpContext 引用。 使用返回值,您可以在源代码在一行中编写多个插入。

备注

插入运算符重载为 CObject 指针以及大多数基元类型。 指向字符的指针生成字符串内容转储;为 void 的指针只生成该地址的十六进制转储。 LONGLONG 生成一个64位带符号整数的转储; ULONGLONG 导致64位无符号整数的转储。

如果您的选件类的实现使用 IMPLEMENT_DYNAMICIMPLEMENT_SERIAL 宏,则插入运算符,通过 CObject::Dump,将打印您的 CObject的名称派生类。 否则,它将打印 CObject。 如果重写选件类的 Dump 功能,则可以提供对象的内容的更有意义的输出而不是十六进制转储。

示例

#if _DEBUG
   CStringList li;
   li.AddHead(_T("item 0"));
   li.AddHead(_T("item 1"));
   CString s = _T("test");
   int i = 7;
   long lo = 1000000000L;
   LONGLONG lolo = 12345678901234i64;
   afxDump << _T("list=") << &li << _T("string=")
      << s << _T("int=") << i << _T("long=") << lo 
      << _T("LONGLONG=") << lolo << _T("\n");
#endif

要求

Header: afx.h

请参见

参考

CDumpContext Class

层次结构图