📄 ustring.h
字号:
// UString.h: interface for the CUString class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_USTRING_H__63EDD959_0E60_4649_A0F7_34435BCAEC8D__INCLUDED_)
#define AFX_USTRING_H__63EDD959_0E60_4649_A0F7_34435BCAEC8D__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "DDKTestEnv.h"
class CUString {
public:
CUString() {Init(); } // constructor relies on internal Init function
CUString(const char* pAnsiString);
CUString(PCWSTR pWideString);
~CUString(); // destructor gives back buffer allocation
void Init(); // performs "real" initialization
void Free(); // performs real destruct
CUString(const CUString& orig); // copy constructure (required)
CUString operator=(const CUString& rop); // assignment operator overload (required)
BOOLEAN operator==(const CUString& rop) const; // comparison operator overload
CUString operator+(const CUString& rop) const; // concatenation operator
operator PWSTR() const; // cast operator into wchar_t
operator ULONG() const; // cast operator into ULONG
CUString(ULONG value); // converter: ULONG->CUString
WCHAR& operator[](int idx); // buffer access operator
USHORT Length() {return uStr.Length/2;}
protected:
public:
UNICODE_STRING uStr; // W2K kernel structure for Unicode string
enum ALLOC_TYPE {Empty, FromCode, FromPaged, FromNonPaged};
ALLOC_TYPE aType; // where buffer is allocated
};
#endif // !defined(AFX_USTRING_H__63EDD959_0E60_4649_A0F7_34435BCAEC8D__INCLUDED_)
/**********************如何向二维或三维参数传递指针*********************/
/*
#include "stdafx.h"
#include <iostream.h>
#include <stdio.h>
void tf2(char** p)
{
sprintf(p[0],"%s\0","agv");
}
void qf3(char*** p)
{
sprintf(p[0][0],"%s\0","ABC");
}
int main(int argc, char* argv[])
{
char *t[3];
t[0] = new char[10];
t[1] = new char[10];
t[2] = new char[10];
tf2(t);
char **x[3];
x[0]=t;
qf3(x);
delete [] t[0];
delete [] t[1];
delete [] t[2];
return 0;
}
*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -