本文整理汇总了C++中Parse类的典型用法代码示例。如果您正苦于以下问题:C++ Parse类的具体用法?C++ Parse怎么用?C++ Parse使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Parse类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnTalletaRaportti
void CTaikaDlg::OnTalletaRaportti()
{
Parse parse;
if(m_mainShowMode == SHOW_RAPORTIT && pageRaportit.IsWindowVisible()) // Talleta valitut ID_WORKUNIT/ID_SALESUNIT-tiedostoon (.tta)
{ parse.talletaTTI(this->GetSafeHwnd(), pageRaportit.getMode()); }
}
示例2: accepts
int accepts(const char *str)
{
std::string input(str);
Parse p;
AstNode *stmt = p.parse(input.begin());
return (stmt->strtail == input.end());
}
示例3: processFile
void processFile(string *src) {
const char *source = src->c_str();
Parse parse = Parse();
char *out = NULL;
string from = input; from += "/"; from += source;
string to = temp; to += "/"; to += source;
if(rename(from.c_str(), to.c_str()) < 0) {
cerr << "rename failed" << endl;
return;
}
out = parse.parse(to.c_str());
if(out == NULL) {
cerr << "wystąpił błąd przy parsowaniu" << to << endl;
} else {
string dest = output; dest += "/"; dest += source;
FILE *destFile = fopen(dest.c_str(), "w");
if(destFile == NULL) {
cerr << "nie można otworzyć pliku " << dest << endl;
return;
}
//printf("%p\n", destFile);
if(fprintf(destFile, "%s", out) < 0) {
cerr << "fprintf failed" << endl;
return;
}
fclose(destFile);
}
if(remove(to.c_str()) < 0) {
cerr << "nie można usunąć " << to << endl;
return;
}
delete[] out;
delete src;
}
示例4: locker
void GrabberScript::parseDBTree(const QString &feedtitle, const QString &path,
const QString &pathThumb, QDomElement& domElem,
const ArticleType &type)
{
QMutexLocker locker(&m_lock);
Parse parse;
ResultItem::resultList articles;
// File Handling
QDomElement fileitem = domElem.firstChildElement("item");
while (!fileitem.isNull())
{ // Fill the article list...
articles.append(parse.ParseItem(fileitem));
fileitem = fileitem.nextSiblingElement("item");
}
while (!articles.isEmpty())
{ // Insert the articles in the DB...
insertTreeArticleInDB(feedtitle, path,
pathThumb, articles.takeFirst(), type);
}
// Directory Handling
QDomElement diritem = domElem.firstChildElement("directory");
while (!diritem.isNull())
{
QDomElement subfolder = diritem;
QString dirname = diritem.attribute("name");
QString dirthumb = diritem.attribute("thumbnail");
dirname.replace("/", "|");
QString pathToUse;
if (path.isEmpty())
pathToUse = dirname;
else
pathToUse = QString("%1/%2").arg(path).arg(dirname);
parseDBTree(feedtitle,
pathToUse,
dirthumb,
subfolder,
type);
diritem = diritem.nextSiblingElement("directory");
}
}
示例5: OnTalletaListat
void CTaikaDlg::OnTalletaListat()
{
Parse parse;
if(m_mainShowMode == SHOW_LISTAT && pageListat.IsWindowVisible()) // Talleta listat
{ parse.talletaTTA(this->GetSafeHwnd(), "", 0, 0, 0, 0, MODE_SAVE); }
}
示例6: getArgsForTable
void Fixture::getArgsForTable(Parse *table)
{
QStringList argumentList;
Parse *parameters = table->parts->parts->more;
for (; parameters ; parameters = parameters->more)
argumentList.append(parameters->text());
args = argumentList;
}
示例7: getLinkedFixtureWithArgs
Fixture* Fixture::getLinkedFixtureWithArgs(Parse *tables)
{
Parse *header = tables->at(0, 0, 0);
Fixture *fixture = loadFixture(header->text());
fixture->counts = counts;
fixture->summary = summary;
fixture->getArgsForTable(tables);
return fixture;
}
示例8: OnAvaaListat
/////////////////////////////////////////////////////////////////////////////
// IDM_LISTAT_MENU - Menu itemien viestit
void CTaikaDlg::OnAvaaListat()
{
Parse parse;
if(m_mainShowMode == SHOW_LISTAT && pageListat.IsWindowVisible()) // Avaa .tta-tiedosto
{ if(!parse.avaaTTA(this->GetSafeHwnd())) return; }
paivitaNaytot(FALSE, FALSE, FALSE, SYNC_ALL);
}
示例9: process
void Search::process()
{
Parse parse;
m_videoList = parse.parseRSS(m_document);
QDomNodeList entries = m_document.elementsByTagName("channel");
if (entries.count() == 0)
{
m_numResults = 0;
m_numReturned = 0;
m_numIndex = 0;
return;
}
QDomNode itemNode = entries.item(0);
QDomNode Node = itemNode.namedItem(QString("numresults"));
if (!Node.isNull())
{
m_numResults = Node.toElement().text().toUInt();
}
else
{
QDomNodeList count = m_document.elementsByTagName("item");
if (count.count() == 0)
m_numResults = 0;
else
m_numResults = count.count();
}
Node = itemNode.namedItem(QString("returned"));
if (!Node.isNull())
{
m_numReturned = Node.toElement().text().toUInt();
}
else
{
QDomNodeList entries = m_document.elementsByTagName("item");
if (entries.count() == 0)
m_numReturned = 0;
else
m_numReturned = entries.count();
}
Node = itemNode.namedItem(QString("startindex"));
if (!Node.isNull())
{
m_numIndex = Node.toElement().text().toUInt();
}
else
m_numIndex = 0;
}
示例10: main
int main(int argc, char **argv) {
if(argc < 2) {
cerr << "musisz podać plik jako argument" << endl;
return -1;
}
Parse parse;
char *out = parse.parse((const char*)argv[1]);
if(out != NULL) printf("%s\n", out);
return 0;
}
示例11: OnAvaaRaporttiTm
/////////////////////////////////////////////////////////////////////////////
// IDM_TYOMATKAT_MENU - Menu itemien viestit
void CTaikaDlg::OnAvaaRaporttiTm()
{
//int s;
Parse parse;
if(m_mainShowMode == SHOW_TYOMATKAT && pageTyomatkat.IsWindowVisible()) // Avaa .tti-tiedosto
{ if(!parse.avaaTTI(this->GetSafeHwnd())) return; }
paivitaNaytot(TRUE, TRUE, FALSE, SYNC_ALL);
}
示例12: OnTalletaRaporttiTm
void CTaikaDlg::OnTalletaRaporttiTm()
{
Parse parse;
vector <ItemData_travel*> id_vect;
// Haetaan GetSaveFileName()-funktiossa valitun tilan mukaan vektoriin talletettavat tiedot
if(m_mainShowMode != SHOW_TYOMATKAT || !pageTyomatkat.IsWindowVisible()) return;
pageTyomatkat.haeItemDataList(&id_vect, MODE_TYONTEKIJANTIEDOT);
if(id_vect.size() > 0)
{
parse.talletaTTI_tyomatkat(this->GetSafeHwnd(), id_vect); // Talletetaan
pageTyomatkat.vapautaItemDataList(&id_vect, MODE_TYONTEKIJANTIEDOT); // Vapautetaan muisti
}
}
示例13: OnMsgUusiRaportti
LRESULT CTaikaDlg::OnMsgUusiRaportti(WPARAM wparam, LPARAM lparam)
{
//int s;
Parse parse;
this->BringWindowToTop();
parse.parseSaapuneet(PARSE_ADD_FILE); // Parsitaan saapuneet lista ja päivitetään näytöt
if(wparam == PARAM_TTI || wparam == PARAM_TTA)
paivitaNaytot(TRUE, TRUE, FALSE, SYNC_ALL);
return 0;
}
示例14: containsPunct
bool AttachContextGenerator::containsPunct(Collection<Parse*> *puncts, const std::string &punct)
{
if (puncts != 0)
{
for (Collection<Parse*>::const_iterator pi = puncts->begin(); pi != puncts->end(); ++pi)
{
Parse *p = *pi;
if (p->getType() == punct)
{
return true;
}
}
}
return false;
}
示例15: main
int main() {
string line = "";
cout << "> ";
while (getline(cin, line))
{
if (line == "quit")
{
cout << "\tquit\n";
return 0;
}
Parse parse;
parse.ReadInput(line);
line = "";
cout << "> ";
}
return 0;
}