commit 2025-08-23 21:30 edit a bit ZCppMain/ZMainXhtml.H
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
2025-08-22
|
|
||||||
|
|
||||||
/*//////////////////////////////////////////////////////////////////////////////////////
|
/*//////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -7,29 +7,36 @@
|
|||||||
namespace ZNsMain
|
namespace ZNsMain
|
||||||
{
|
{
|
||||||
|
|
||||||
template<typename TStringData> TStringData& ZftConvertXhtml(TStringData& ARR_CString)
|
template<typename TStringData> TStringData& ZftConvertXhtml(TStringData& ARRoCString)
|
||||||
{
|
{
|
||||||
/* 데이타를 그대로 클라이언트에 전송하면
|
/* 데이타를 그대로 클라이언트에 전송하면, HTML 태그와
|
||||||
HTML 태그와 혼동될 수 있는데 이를 방지하기 위해
|
혼동될 수 있는데, 이를 방지하기 위해 적절히 인코딩한다.
|
||||||
적절히 인코딩한다.
|
|
||||||
*/
|
*/
|
||||||
return ARR_CString.
|
return ARRoCString.
|
||||||
Replace("&" ,"&" ). Replace("<" ,"<" ).
|
Replace("&" ,"&" ). Replace("<" ,"<" ).
|
||||||
Replace(">" ,">" ). Replace(" " ," ").
|
Replace(">" ,">" ). Replace(" " ," ").
|
||||||
Replace("\n","<br />" );
|
Replace("\n","<br />" );
|
||||||
}/*
|
}/*
|
||||||
template<typename TStringData> static TStringData& ConvertXhtml(TStringData& ARR_CString) */
|
template<typename TStringData> TStringData& ConvertXhtml(TStringData& ARRoCString) */
|
||||||
|
|
||||||
template<typename TStringData> TStringData& ZftConvertXhtmlAtt(TStringData& ARR_CString)
|
|
||||||
|
template<typename TStringData> TStringData& ZftMakeXmlAttEnc(TStringData& ARRoCStringData)
|
||||||
{
|
{
|
||||||
// X(H)TML 의 속성에 올 수 있는 값으로 인코딩한다.
|
return ARRoCStringData.
|
||||||
|
Replace("&" , "&" ).Replace("\r", "
" ).
|
||||||
return ARR_CString.
|
Replace("\n", "
" ).Replace("\t", "	" ).
|
||||||
Replace("&" ,"&" ). Replace("<" ,"<" ).
|
Replace("\"", """).Replace(">" , ">" ).Replace("<", "<");
|
||||||
Replace(">" ,">" ). Replace("\"",""" ).
|
|
||||||
Replace("\r","
" ). Replace("\n","
" );
|
|
||||||
}/*
|
}/*
|
||||||
template<typename TStringData> TStringData& ZftConvertXhtmlAtt(TStringData& ARR_CString) */
|
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*/
|
namespace ZNsMain*/
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#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"
|
||||||
@ -22,27 +23,6 @@ namespace ZNsMain
|
|||||||
namespace ZNsView*/
|
namespace ZNsView*/
|
||||||
|
|
||||||
|
|
||||||
template<typename TCStringData> TCStringData& ZftMakeXmlAttEnc(TCStringData& ARR_CStringData)
|
|
||||||
{
|
|
||||||
return ARR_CStringData.
|
|
||||||
|
|
||||||
Replace("&" ,"&" ).Replace("\r", "
").
|
|
||||||
Replace("\n", "
" ).Replace("\t", "	").
|
|
||||||
Replace("\"", """).Replace(">" , ">" ).Replace("<", "<" );
|
|
||||||
}/*
|
|
||||||
template<typename TCStringData> TCStringData& ZftMakeXmlAttEnc(TCStringData& ARR_CStringData)*/
|
|
||||||
|
|
||||||
template<typename TCStringData> TCStringData& ZftMakeXmlAttDec(TCStringData& ARR_CStringData)
|
|
||||||
{
|
|
||||||
return ARR_CStringData.
|
|
||||||
|
|
||||||
Replace("
" ,"\r" ). Replace("
" ,"\n" ).
|
|
||||||
Replace("	" ,"\t" ). Replace(""","\"" ).
|
|
||||||
Replace(">" ,">" ). Replace("<" ,"<" ). Replace("&" ,"&" );
|
|
||||||
}/*
|
|
||||||
template<typename TCStringData> TCStringData& ZftMakeXmlAttDec(TCStringData& ARR_CStringData)*/
|
|
||||||
|
|
||||||
|
|
||||||
namespace ZNsType
|
namespace ZNsType
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
#include "ZCppMain/ZMainHead.H"
|
#include "ZCppMain/ZMainHead.H"
|
||||||
#include "ZCppMain/ZMainHeadEx.H"
|
#include "ZCppMain/ZMainHeadEx.H"
|
||||||
#include "ZCppMain/ZMainXhtml.H"
|
|
||||||
#include "ZCppMain/ZtCMainChars.H"
|
#include "ZCppMain/ZtCMainChars.H"
|
||||||
#include "ZCppMain/ZtCObjList.H"
|
#include "ZCppMain/ZtCObjList.H"
|
||||||
|
|
||||||
@ -7749,19 +7748,6 @@ namespace ZNsMain
|
|||||||
int Compare(const TypeChar* APC_Data) const*/
|
int Compare(const TypeChar* APC_Data) const*/
|
||||||
|
|
||||||
|
|
||||||
ZCStringBase& ConvertXhtml()
|
|
||||||
{
|
|
||||||
return ZNsMain::ZftConvertXhtml(*this);
|
|
||||||
}/*
|
|
||||||
ZCStringBase& ConvertXhtml()*/
|
|
||||||
|
|
||||||
ZCStringBase& ConvertXhtmlAtt()
|
|
||||||
{
|
|
||||||
return ZNsMain::ZftConvertXhtmlAtt(*this);
|
|
||||||
}/*
|
|
||||||
ZCStringBase& ConvertXhtmlAtt()*/
|
|
||||||
|
|
||||||
|
|
||||||
ZCStringBase& Fetch(ZCStringBase& rhs)
|
ZCStringBase& Fetch(ZCStringBase& rhs)
|
||||||
{
|
{
|
||||||
// rhs 로부터 문자열 메모리를 그대로 가져온다.
|
// rhs 로부터 문자열 메모리를 그대로 가져온다.
|
||||||
|
Reference in New Issue
Block a user