/*
 * 임의의 nav 노드에서 목차 타이틀과, href 를 추출한다.
 * 파라미터	[in] liElement	타이틀과 href 를 추출하고자 하는 nav element
 *			[out] href		목차의 href
 *			[out] title		목차명
 * 리턴값 true(success) / false(fail)
 */
bool NAVXML::GetHrefAndTitleFromLI(const CXMLDOMElement &liElement, TString<wchar_t> &href, TString<wchar_t> &title)
{
	CXMLDOMElement aElem = liElement.SelectSingleNode(USTR("./a"));
	if ( aElem )
	{
		aElem.GetAttribute(USTR("href"), href);
		aElem.GetText(title);
		return true;
	}
	
	CXMLDOMElement spanElem = liElement.SelectSingleNode(USTR("./span"));
	if ( spanElem )
	{
		href.Empty();
		spanElem.GetText(title);
		return true;
	}

	href.Empty();
	title.Empty();
	return false;
}
Example #2
0
int TFile::ReadPropertyLine(TString &strA, TString &strB)
{
	BOOL bVal = FALSE;
	UINT rd = 0;
	char ch;

	strA.Empty();
	strB.Empty();

	while(ch = getc(m_fHandle), !feof(m_fHandle))
	{

		rd ++;

		if (ch == '=')
		{
			bVal = TRUE;
		}
		else if ((ch == 0x0a) || (ch == 0x0d))
		{
			if (rd > 1)
				return 1;
		}
		else if (bVal == TRUE)
		{
			strB += ch;
		}
		else
		{
			strA += ch;
		}

	}

	return feof(m_fHandle) ? 0 : 1;
}
Example #3
0
void VAISNAVADAY::GetFastingSubject(TString &strFest, int &nFast, TString &strFastSubj)
{
	int nf, nf2;

	// default values
	nFast = 0;
	strFastSubj.Empty();

	// finding fast subject
	nf = strFest.Find("[f:");
	if (nf >= 0 && nf < strFest.GetLength())
	{
		// ziskava typ postu
		nFast = strFest.GetAt(nf+3) - '0';
		nf2 = strFest.Find("]", nf);
		if (nf2 >= 0)
		{
			strFest.Mid(nf + 5, nf2 - nf - 5, strFastSubj);
		}
		strFest.Delete(nf, strFest.GetLength() - nf);
	}
}
Example #4
0
bool VAISNAVADAY::GetNextFestival(int &i, TString &str)
{
	str.Empty();

	if (i < 0)
		return FALSE;

	while(i < festivals.GetLength() && festivals.GetAt(i) != '#')
	{
		str += festivals.GetAt(i);
		i++;
	}

	if (i < festivals.GetLength())
	{
		i++;
	}
	else
	{
		i = -1;
	}

	return TRUE;
}