#ifndef __DCL_HTML_ENTITY_H__
#define __DCL_HTML_ENTITY_H__ 20050530_20060103
#ifndef __DCL_STRING_H__
#include <dcl/core/String.h>
#endif
#ifndef __DCL_STREAM_H__
#include <dcl/core/Stream.h>
#endif
// XHTML Entity Sets
// http://www.w3.org/TR/xhtml1/dtds.html#h-A2
__DCL_BEGIN_NAMESPACE
/*
class DCLNAPI HtmlEntityEncoder
{
public:
// '<' ==> <
// '>' ==> >
// ' ' ==>
// ... etc
static String encode(
const char* psz,
const char* pszTabReplace = NULL, // replace none
const char* pszLineFeedReplace = NULL // replace none
);
void encode(
OutputStream& output,
const char* psz,
const char* pszTabReplace = NULL, // replace none
const char* pszLineFeedReplace = NULL // replace none
);
};
*/
class DCLNAPI Html
{
public:
// '<' ==> < <
// '>' ==> > >
// '&' ==> & &
// '"' ==> " "
// ''' ==> ' '
static String escape(
const String& str,
const char* pszCharSet // " <>"'&, NULL is all
);
static String strip(
const String& str,
const char* pszElementNames // NULL(all) or ',' delimiter ex: "html,head,meta,!"
);
static String format(
const String& str,
int nTab2Space,
const String& strBeginOfLine,
const String& strEndOfLine
);
};
__DCL_END_NAMESPACE
#endif // __DCL_HTML_ENTITY_H__