示例#1
0
CString JoinPaths(const CString& HeadPath, const CString& TailPath, const char Separator)
{
 CString head_path, tail_path;
 bool head_quoted = IsQuoted(HeadPath);
 bool tail_quoted = IsQuoted(TailPath);
 bool quote_path = head_quoted&&tail_quoted;
 if (quote_path) head_path = UnquoteStr(HeadPath); else head_path = HeadPath;
 if (quote_path) tail_path = UnquoteStr(TailPath); else tail_path = TailPath;
 CString result = head_path;
 if (!head_path.IsEmpty() && !tail_path.IsEmpty())
 {
  result = CheckLastChar(head_path,Separator);
 }
 result += tail_path;
 if (quote_path) result = QuoteStr(result);
 return result;
}
示例#2
0
CString CCString::Print (CCodeChain *pCC, DWORD dwFlags)

//	Print
//
//	Print item

	{
	//	If it is quoted we need to surround the entry with quotes

	if (IsQuoted())
		dwFlags |= PRFLAG_FORCE_QUOTES;

	//	Do it

	return Print(m_sValue, dwFlags);
	}