Author Topic: EditorManager::ReplaceInFiles  (Read 3910 times)

Offline vmlobanov78

  • Single posting newcomer
  • *
  • Posts: 4
EditorManager::ReplaceInFiles
« on: February 12, 2012, 04:27:08 am »
In File:        sdk/editormanager.cpp
In Function:  int EditorManager::ReplaceInFiles(cbFindReplaceData* data)

From:
Code: [Select]
fileContents = cbReadFileContents(file, def_encoding);
if (fileContents.Find(data->findText) == -1)
{
continue;
}
To:
Code: [Select]
fileContents = cbReadFileContents(file, def_encoding);
if(!data->regEx)
{
if (fileContents.Find(data->findText) == -1)
{
continue;
}
}else if( AdvRegex && re.Matches(fileContents)==0)
{
continue;
}

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9595
Re: EditorManager::ReplaceInFiles
« Reply #1 on: February 12, 2012, 09:26:22 am »
In File:        sdk/editormanager.cpp
In Function:  int EditorManager::ReplaceInFiles(cbFindReplaceData* data)
I don't understand what you are trying to tell...?!

Can you please explain what you show here and not just post code snippets?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline ptDev

  • Almost regular
  • **
  • Posts: 222
Re: EditorManager::ReplaceInFiles
« Reply #2 on: February 12, 2012, 10:21:01 am »
Is regular expression replace in files broken?

Offline vmlobanov78

  • Single posting newcomer
  • *
  • Posts: 4
Re: EditorManager::ReplaceInFiles
« Reply #3 on: February 12, 2012, 11:46:18 am »
Is regular expression replace in files broken?

Yes.

I'm from Russia. I don't speak English.

First code ("From") place - string number ~ 1980-1990 in file sdk/editormanager.cpp

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: EditorManager::ReplaceInFiles
« Reply #4 on: February 12, 2012, 01:05:17 pm »
Can you tell us, what you expect and what does not work.

Offline vmlobanov78

  • Single posting newcomer
  • *
  • Posts: 4
Re: EditorManager::ReplaceInFiles
« Reply #5 on: February 12, 2012, 02:43:03 pm »
When I want to do "Replace in files" with options: "Regular expression" and  scope "Projects files" or "Workspace files"

In closed files does not result.
Because:
Code: [Select]
fileContents.Find(data->findText) == -1with "RegExp" can produce results "true"