commit 2025-08-28 15:42 add func of ZMainXhtml.H in ZCppMain/ZMainHead.H and delete ZMainXhtml.H
This commit is contained in:
@ -3677,6 +3677,46 @@ namespace ZNsCPP */
|
|||||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
namespace ZNsMain
|
||||||
|
{
|
||||||
|
|
||||||
|
template<typename TStringData> TStringData& ZftConvertXhtml(TStringData& ARRoCString)
|
||||||
|
{
|
||||||
|
/* 데이타를 그대로 클라이언트에 전송하면, HTML 태그와
|
||||||
|
혼동될 수 있는데, 이를 방지하기 위해 적절히 인코딩한다.
|
||||||
|
*/
|
||||||
|
return ARRoCString.
|
||||||
|
Replace("&" ,"&" ). Replace("<" ,"<" ).
|
||||||
|
Replace(">" ,">" ). Replace(" " ," ").
|
||||||
|
Replace("\n","<br />" );
|
||||||
|
}/*
|
||||||
|
template<typename TStringData> TStringData& ConvertXhtml(TStringData& ARRoCString) */
|
||||||
|
|
||||||
|
|
||||||
|
template<typename TStringData> TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)
|
||||||
|
{
|
||||||
|
return ARRoCStringData.
|
||||||
|
Replace("&" , "&" ).Replace("\r", "
" ).
|
||||||
|
Replace("\n", "
" ).Replace("\t", "	" ).
|
||||||
|
Replace("\"", """).Replace(">" , ">" ).Replace("<", "<");
|
||||||
|
}/*
|
||||||
|
template<typename TStringData> TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)*/
|
||||||
|
|
||||||
|
template<typename TStringData> TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData)
|
||||||
|
{
|
||||||
|
return ARRoCStringData.
|
||||||
|
Replace("
" ,"\r" ). Replace("
" ,"\n").
|
||||||
|
Replace("	" ,"\t" ). Replace(""","\"").
|
||||||
|
Replace(">" ,">" ). Replace("<" ,"<" ). Replace("&" ,"&" );
|
||||||
|
}/*
|
||||||
|
template<typename TStringData> TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData)*/
|
||||||
|
|
||||||
|
}/*
|
||||||
|
namespace ZNsMain*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
/*///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
■ 4.1 자동적으로 정의되는 심볼들
|
■ 4.1 자동적으로 정의되는 심볼들
|
||||||
|
@ -1,45 +0,0 @@
|
|||||||
|
|
||||||
|
|
||||||
#ifndef __ZCPPMAIIN__ZMAINXHTML_H__
|
|
||||||
#define __ZCPPMAIIN__ZMAINXHTML_H__
|
|
||||||
|
|
||||||
|
|
||||||
namespace ZNsMain
|
|
||||||
{
|
|
||||||
|
|
||||||
template<typename TStringData> TStringData& ZftConvertXhtml(TStringData& ARRoCString)
|
|
||||||
{
|
|
||||||
/* 데이타를 그대로 클라이언트에 전송하면, HTML 태그와
|
|
||||||
혼동될 수 있는데, 이를 방지하기 위해 적절히 인코딩한다.
|
|
||||||
*/
|
|
||||||
return ARRoCString.
|
|
||||||
Replace("&" ,"&" ). Replace("<" ,"<" ).
|
|
||||||
Replace(">" ,">" ). Replace(" " ," ").
|
|
||||||
Replace("\n","<br />" );
|
|
||||||
}/*
|
|
||||||
template<typename TStringData> TStringData& ConvertXhtml(TStringData& ARRoCString) */
|
|
||||||
|
|
||||||
|
|
||||||
template<typename TStringData> TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)
|
|
||||||
{
|
|
||||||
return ARRoCStringData.
|
|
||||||
Replace("&" , "&" ).Replace("\r", "
" ).
|
|
||||||
Replace("\n", "
" ).Replace("\t", "	" ).
|
|
||||||
Replace("\"", """).Replace(">" , ">" ).Replace("<", "<");
|
|
||||||
}/*
|
|
||||||
template<typename TStringData> TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)*/
|
|
||||||
|
|
||||||
template<typename TStringData> TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData)
|
|
||||||
{
|
|
||||||
return ARRoCStringData.
|
|
||||||
Replace("
" ,"\r" ). Replace("
" ,"\n").
|
|
||||||
Replace("	" ,"\t" ). Replace(""","\"").
|
|
||||||
Replace(">" ,">" ). Replace("<" ,"<" ). Replace("&" ,"&" );
|
|
||||||
}/*
|
|
||||||
template<typename TStringData> TStringData& ZftMakeXmlAttDec(TStringData& ARRoCStringData)*/
|
|
||||||
|
|
||||||
}/*
|
|
||||||
namespace ZNsMain*/
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __ZCPPMAIIN__ZMAINXHTML_H__
|
|
@ -4,7 +4,6 @@
|
|||||||
#define __ZNSMAIN_ZTCLOADXML_H__
|
#define __ZNSMAIN_ZTCLOADXML_H__
|
||||||
|
|
||||||
|
|
||||||
#include "ZCppMain/ZMainXhtml.H"
|
|
||||||
#include "ZCppMain/ZtCStringEx.H"
|
#include "ZCppMain/ZtCStringEx.H"
|
||||||
#include "ZCppMain/ZtCTreeData.H"
|
#include "ZCppMain/ZtCTreeData.H"
|
||||||
#include "ZCppMain/ZtCObjList.H"
|
#include "ZCppMain/ZtCObjList.H"
|
||||||
|
Reference in New Issue
Block a user