Click here to Skip to main content
15,892,161 members
Articles / Web Development / HTML

DHTML Editor with Table Support and Source Editor

Rate me:
Please Sign up or sign in to vote.
4.95/5 (85 votes)
14 Feb 2011CPOL15 min read 665.9K   10K   197  
A complete class encapsulating a versatile HTML editor
// ---------------------------------------------------------------------------------------------------------
//
// CFastString class
// 
// Purpose: Speed-Optimized String class
//          The Microsoft CString class is optimized for low memory consumption but not for speed.
//          If a CString has 1000 Bytes and you append 30 Bytes it will reallocate 1030 Bytes.
//          CFastString duplicates the memory each time more memory is required and so avoids unnecessary reallocations
//          Allocating memory on the heap is slow and should be avoided where ever possible
//
// Tipp:    To understand what's going on in CString study the source code in STRCORE.CPP
//
// Author:  Elm�Soft (www.netcult.ch)
//
// ---------------------------------------------------------------------------------------------------------

#pragma once

#ifndef __AFXWIN_H__
	#error include 'stdafx.h' before including this file for PCH
#endif


class CFastString
{
public:
	CFastString(DWORD u32_InitialSize);
	void AppendBuffer(const TCHAR* t_Data, int s32_Characters=-1);
	void AppendString(CString& s_Data);
	void Empty();
	BSTR AllocSysString();
	CString GetString();

private:
	CString ms_String;
	DWORD   mu32_Allocated;
};




By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) ElmüSoft
Chile Chile
Software Engineer since 40 years.

Comments and Discussions