コード例 #1
0
void KRegExpEditorPrivate::slotUpdateEditor( const TQString & txt)
{
  _updating = true;
  bool ok;
  if ( !RegExpConverter::current()->canParse() ) {
      // This can happend if the application set a text through the API.
  }
  else {
      RegExp* result = RegExpConverter::current()->parse( txt, &ok );
      if ( ok ) {
          TQPtrList<CompoundRegExp> list = _userRegExps->regExps();
          for ( TQPtrListIterator<CompoundRegExp> it( list ); *it; ++it ) {
              result->replacePart( *it );
          }

          _scrolledEditorWindow->slotSetRegExp( result );
          _error->hide();
          maybeVerify( );
          recordUndoInfo();
          result->check( _errorMap );
      }
      else {
          _error->show();
          if ( _autoVerify )
              _verifier->clearRegexp();
      }
      delete result;
  }
  _updating = false;
}
コード例 #2
0
void KRegExpEditorPrivate::slotUpdateLineEdit()
{
  if ( _updating )
    return;
  _updating = true;

  RegExp* regexp = _scrolledEditorWindow->regExp();
  regexp->check( _errorMap );

  TQString str = RegExpConverter::current()->toStr( regexp, false );
  _regexpEdit->setText( str );
  delete regexp;

  recordUndoInfo();

  _updating = false;
}
コード例 #3
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<8>(void)
{
  const RegExp re("ab*", true);
  ensure("regexp does not match valid string", re.check("a") );
}
コード例 #4
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<6>(void)
{
  const RegExp re("a\\d{2}[bc]", true);
  ensure("regexp does not match matching string", re.check("a12c") );
}
コード例 #5
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<7>(void)
{
  const RegExp re("a\\d{2}[bc]", true);
  ensure("regexp matches invalid string", re.check("a2c")==false );
}
コード例 #6
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<4>(void)
{
  const RegExp re("^full$", true);
  ensure("exact regexp matches different string", re.check("not full")==false );
}
コード例 #7
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<5>(void)
{
  const RegExp re("ABC", true);
  ensure("exact regexp does not match", re.check("xx abc yy")==false );
}
コード例 #8
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<3>(void)
{
  const RegExp re("^full$", true);
  ensure("exact regexp does not match", re.check("full") );
}
コード例 #9
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<2>(void)
{
  const RegExp re("x", true);
  ensure("string does not match valid regexp", re.check("axc") );
}
コード例 #10
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<1>(void)
{
  const RegExp re("", true);
  ensure("string does not match empty regexp", re.check("abc") );
}
コード例 #11
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<12>(void)
{
  const RegExp re("ab+", false);
  ensure("case-insensitive regexp matches invalid string", re.check("A") );
}
コード例 #12
0
ファイル: RegExp.t.cpp プロジェクト: el-bart/ACARM-ng
void testObj::test<11>(void)
{
  const RegExp re("ab+", false);
  ensure("case-insensitive regexp does not match valid string", re.check("AB") );
}