本文整理汇总了C++中BrowserNode::load方法的典型用法代码示例。如果您正苦于以下问题:C++ BrowserNode::load方法的具体用法?C++ BrowserNode::load怎么用?C++ BrowserNode::load使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BrowserNode
的用法示例。
在下文中一共展示了BrowserNode::load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load
// load package definition
bool BrowserNode::load(QDir & dir)
{
BooL ro = FALSE;
char * buff = read_file(dir, filename, ro);
if (buff == 0)
return FALSE;
char * p = buff;
read_token(p); // 'format'
read_token(p); // format
setText(TREE_COL, read_string(p));
char * k = read_token(p);
if (!strcmp(k, "revision")) {
setText(REVISION_COL, read_token(p));
k = read_token(p);
if (!strcmp(k, "modified_by")) {
int n = atoi(read_token(p));
k = read_string(p);
if ((n >= 2) && (n <= 127)) {
modifier_name = k;
modifier_id = n;
setText(MODIFIEDBY_COL, modifier_name + " [" + QString::number(n) + "]");
set_user_name(n, k);
}
k = read_token(p);
}
}
else {
setText(REVISION_COL, "0");
}
QStringList sub_packages_id;
while (k != 0) {
if (! strcmp(k, "package_ref"))
sub_packages_id.append(read_token(p));
else if (! strcmp(k, "simplerelation")) {
// may contain package_ref
do
k = read_token(p);
while ((k != 0) && strcmp(k, "end"));
}
else if (! strcmp(k, "class")) {
QString fn = read_token(p) + QString(".bodies");
classes.append(fn);
ro |= is_readonly(dir, fn);
}
else if (! strcmp(k, "activitydiagram") ||
! strcmp(k, "classdiagram") ||
! strcmp(k, "deploymentdiagram") ||
! strcmp(k, "collaborationdiagram") ||
! strcmp(k, "componentdiagram") ||
! strcmp(k, "deploymentdiagram") ||
! strcmp(k, "objectdiagram") ||
! strcmp(k, "sequencediagram") ||
! strcmp(k, "statediagram") ||
! strcmp(k, "usecasediagram")) {
QString fn = read_token(p) + QString(".diagram");
diagrams.append(fn);
ro |= is_readonly(dir, fn);
}
k = read_token(p);
}
if (ro)
view->set_readonly();
delete [] buff;
QStringList::Iterator it;
for (it = sub_packages_id.begin(); it != sub_packages_id.end(); ++it) {
BrowserNode * bn = new BrowserNode(this, *it, view);
if (! bn->load(dir))
return FALSE;
}
return TRUE;
}