Author Topic: EditorManager::ReplaceInFiles  (Read 6283 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
fileContents = cbReadFileContents(file, def_encoding);
if (fileContents.Find(data->findText) == -1)
{
continue;
}
To:
Code
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: 9694
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: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://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 Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
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
fileContents.Find(data->findText) == -1
with "RegExp" can produce results "true"