⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 stringptr.h

📁 Java写的文本编辑器
💻 H
字号:
/* * StringPtr.h - part of jEditLauncher package * Copyright (C) 2001 John Gellene * jgellene@nyc.rr.com * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or any later version. * * Notwithstanding the terms of the General Public License, the author grants * permission to compile and link object code generated by the compilation of * this program with object code and libraries that are not subject to the * GNU General Public License, provided that the executable output of such * compilation shall be distributed with source code on substantially the * same basis as the jEditLauncher package of which this program is a part. * By way of example, a distribution would satisfy this condition if it * included a working makefile for any freely available make utility that * runs on the Windows family of operating systems. This condition does not * require a licensee of this software to distribute any proprietary software * (including header files and libraries) that is licensed under terms * prohibiting redistribution to third parties. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. * * $Id: StringPtr.h,v 1.1.1.1 2001/07/03 13:14:11 jgellene Exp $ * * NOTE: this is a convenience wrapper class that works with the CString class * in the Windows Template Library (it should also work with the MFC CString * class with a conforming modification to the definition of the 's' data * member. The effect of the template is to insert inline code that create a * buffer of a length specified by the template parameter and attach it to * the CString object. The destructor releases the buffer. The only caution * is that calling methods on the underlying CString object during the lifetime * of the CStringBuf object will lead to unpredictable results. This * circumstance is no different than the result of calling a WTL/MFC CString * function after a call to its GetBuffer() menthod and before a call to the * corresponding ReleaseBuffer(). * */// StringBuf.h: interface for the CStringBuf class.////////////////////////////////////////////////////////////////////////#if !defined(AFX_STRINGPTR_H__5DC3BF27_5163_4036_81DF_5E15DCFDAF0E__INCLUDED_)#define AFX_STRINGPTR_H__5DC3BF27_5163_4036_81DF_5E15DCFDAF0E__INCLUDED_#if _MSC_VER > 1000#pragma once#endif // _MSC_VER > 1000template<size_t S = 255>class CStringBuf{public:	CStringBuf(WTL::CString& str)		: s(str), p(str.GetBuffer(S)) {}	~CStringBuf() {		Release();	}	void Activate() {		if(p == 0) p = str.GetBuffer(S);	}	void Release() {		if(p != 0) s.ReleaseBuffer(); p = 0;	}	size_t Size() {		return S;	}	operator TCHAR*() {		return p;	}	operator LPARAM() {		return (LPARAM)p;	}	operator LPBYTE() {		return (LPBYTE)p;	}private:	WTL::CString& s;	TCHAR* p;};#endif // !defined(AFX_STRINGPTR_H__5DC3BF27_5163_4036_81DF_5E15DCFDAF0E__INCLUDED_)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -