コード例 #1
0
ファイル: house.cpp プロジェクト: CkyLua/tfs
bool AccessList::parseList(const std::string& _list)
{
	playerList.clear();
	guildList.clear();
	expressionList.clear();
	regExList.clear();
	list = _list;
	if(_list == "")
		return true;

	std::istringstream listStream(_list);
	std::string line;
	while(getline(listStream, line))
	{
		trimString(line);
		trim_left(line, "\t");
		trim_right(line, "\t");
		trimString(line);

		std::transform(line.begin(), line.end(), line.begin(), tolower);
		if(line.substr(0,1) == "#" || line.length() > 100)
			continue;

		if(line.find("@") != std::string::npos)
		{
			std::string::size_type pos = line.find("@");
			addGuild(line.substr(pos + 1), "");
		}
		else if(line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos)
			addExpression(line);
		else
			addPlayer(line);
	}
	return true;
}
コード例 #2
0
FilterExpressionsPreferencesFrame::FilterExpressionsPreferencesFrame(QWidget *parent) :
    QFrame(parent),
    ui(new Ui::FilterExpressionsPreferencesFrame),
    cur_column_(0),
    cur_line_edit_(NULL)
{
    ui->setupUi(this);

    int one_em = ui->expressionTreeWidget->fontMetrics().height();
    ui->expressionTreeWidget->resizeColumnToContents(enabled_col_);
    ui->expressionTreeWidget->setColumnWidth(label_col_, one_em * 10);
    ui->expressionTreeWidget->setColumnWidth(expression_col_, one_em * 5);

    ui->expressionTreeWidget->setMinimumWidth(one_em * 15);
    ui->expressionTreeWidget->setMinimumHeight(one_em * 10);

    ui->expressionTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection);
    ui->expressionTreeWidget->setDragEnabled(true);
    ui->expressionTreeWidget->viewport()->setAcceptDrops(true);
    ui->expressionTreeWidget->setDropIndicatorShown(true);
    ui->expressionTreeWidget->setDragDropMode(QAbstractItemView::InternalMove);

    ui->expressionTreeWidget->clear();

    for (struct filter_expression *fe = *pfilter_expression_head; fe != NULL; fe = fe->next) {
        if (fe->deleted) continue;
        addExpression(fe->enabled, fe->label, fe->expression);
    }

    updateWidgets();
}
コード例 #3
0
ファイル: gateCmdHandler.cpp プロジェクト: qzluo/webConfig
//读数据转化文件,生成转换列表
int CGateCmdHandler::init(void)
{
    char fileName[256] = {0};
    char fileDir[256] = {0};
    char processName[256] = {0};
    FILE* p_file = NULL;
    char szExp[1024] = {0};    

    clearList();

    if (getExePath(fileDir, processName, 256))
        return -1;   

    sprintf(fileName, "%s/%s", fileDir, FILE_DATA_TRANS);

    p_file = fopen(fileName, "r");
    if (!p_file)
        return -1;

    while (fgets(szExp, 1024, p_file)) {
        if (addExpression(szExp)) {
            fclose(p_file);
            return -1;
        }
    }

    fclose(p_file);
    
    return 0;
}
コード例 #4
0
ファイル: MergeJoinRelation.cpp プロジェクト: mgrosso/cplusql
MergeJoinRelation::MergeJoinRelation(  
    RelationPtr left, RelationPtr right, RelationMetaPtr meta,
    ExpressionPtr leftexp, ExpressionPtr rightexp,
    bool str
)
:ProxyRelation(meta)
{
    d_=new MergeJoinRelationPriv();
    if(!d_)
    {
        THROW_NOMEM;
    }
    d_->left_=left;
    d_->right_=right;
    if( str )
    {
        d_->less_ = (Expression *) new StrLessThanExpression( leftexp, rightexp );
        d_->equals_ = (Expression *) new StrEqualsExpression( leftexp, rightexp );
    }else
    {
        d_->less_ = (Expression *) new LessThanExpression( leftexp, rightexp );
        d_->equals_ = (Expression *) new EqualsExpression( leftexp, rightexp );
    }
    for( size_t il=0; il< d_->left_->getNumColumns(); ++il )
    {
        ExpressionPtr el( 
            (Expression *) new ColumnExpression( 
                ( const ptr< AbstractDelimitedSource > &)d_->left_,
                il
            )
        );
        addExpression(el);
    }
    for( size_t ir=0; ir< d_->right_->getNumColumns(); ++ir )
    {
        ExpressionPtr er(
            (Expression *)new ColumnExpression( 
                ( const ptr< AbstractDelimitedSource > &)d_->right_,
                ir
            )
        );
        addExpression(er);
    }
    d_->linenum_=0;
    d_->done_=false;
}
コード例 #5
0
void FilterExpressionsPreferencesFrame::on_copyToolButton_clicked()
{
    if (!ui->expressionTreeWidget->currentItem()) return;
    QTreeWidgetItem *ti = ui->expressionTreeWidget->currentItem();

    addExpression(ti->checkState(enabled_col_) == Qt::Checked,
                  ti->text(label_col_), ti->text(expression_col_));
}
コード例 #6
0
void FilterExpressionsPreferencesFrame::updateWidgets()
{
    ui->expressionTreeWidget->clear();

    for (struct filter_expression *fe = *pfilter_expression_head; fe != NULL; fe = fe->next) {
        if (fe->deleted) continue;
        addExpression(fe->enabled, fe->label, fe->expression);
    }
}
コード例 #7
0
ファイル: ExpressionLibrary.cpp プロジェクト: hbiehl/charanis
void ExpressionLibrary::importExpressionFile(std::string femlDir, std::string fileName) {
    FEMLParser parser = FEMLParser(femlDir);

    FacialExpressionVector* feVec = parser.parseFile(fileName);
    for (FacialExpressionVector::iterator it=feVec->begin(); it!=feVec->end(); it++) {
        addExpression(*it);
    }
    feVec->clear();
    delete feVec;
}
コード例 #8
0
/**
 * VsRegistry::buildExpressions()
 * 
 * A "VsVars" group represents a set of names and values
 * Each attribute in the group represents one expression
 * The name of the attribute is the name of the expression
 * The value of the attribute is the value of the expression
 */
void VsRegistry::buildExpressions(VsGroup* group) {
  if (!group) {
    return;
  }
  VsLog::debugLog() <<"VsRegistry::buildExpressions() - Entering with group " <<group->getFullName() <<std::endl;
  
  std::map<std::string, VsAttribute*>::const_iterator k;
  for (k = group->getAllAttributes().begin(); k != group->getAllAttributes().end(); ++k) {
    VsAttribute* att = (*k).second;
    if (att->getShortName() != VsSchema::typeAtt) {
      std::string s;
      int err = att->getStringValue(&s);
      if (err == 0) {
        addExpression(att->getShortName(), s);
      }
    }
  }
  VsLog::debugLog() <<"VsRegistry::buildExpressions() exiting." <<std::endl;
}
コード例 #9
0
ファイル: house.cpp プロジェクト: HeavenIsLost/ChronusServer
bool AccessList::parseList(const std::string& _list)
{
	playerList.clear();
	guildList.clear();
	expressionList.clear();
	regExList.clear();
	list = _list;

	if (_list.empty()) {
		return true;
	}

	std::istringstream listStream(_list);
	std::string line;

	while (getline(listStream, line)) {
		trimString(line);
		trim_left(line, '\t');
		trim_right(line, '\t');
		trimString(line);

		if (line.empty() || line.front() == '#' || line.length() > 100) {
			continue;
		}

		toLowerCaseString(line);

		std::string::size_type at_pos = line.find("@");
		if (at_pos != std::string::npos) {
			addGuild(line.substr(at_pos + 1));
		} else if (line.find("!") != std::string::npos || line.find("*") != std::string::npos || line.find("?") != std::string::npos) {
			addExpression(line);
		} else {
			addPlayer(line);
		}
	}
	return true;
}
コード例 #10
0
void FilterExpressionsPreferencesFrame::on_newToolButton_clicked()
{
    addExpression(true, "My Filter", NULL); //TODO : Fix Translate
}
コード例 #11
0
void FilterExpressionsPreferencesFrame::on_newToolButton_clicked()
{
    addExpression(true, new_button_label_, QString());
}
コード例 #12
0
ファイル: input.cpp プロジェクト: denrusio/vak-opensource
/*** Constructor ***/
Input::Input(Object* pExpr, bool pGetText)
{
	addExpression(pExpr);
	setText(pGetText);
}
コード例 #13
0
ファイル: subquerystep.cpp プロジェクト: DYFeng/infinidb
void SubAdapterStep::addFcnJoinExp(const vector<SRCP>& exps)
{
	addExpression(exps);
}