• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Kate

  • KateCommands
  • SedReplace
Classes | Public Member Functions | Static Public Member Functions | List of all members
KateCommands::SedReplace Class Reference

#include <katecmds.h>

Inherits Command, and RangeCommand.

Classes

class  InteractiveSedReplacer
 

Public Member Functions

 ~SedReplace ()
 
const QStringList & cmds ()
 
bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg)
 
bool exec (class KTextEditor::View *view, const QString &cmd, QString &errorMsg, const KTextEditor::Range &r)
 
bool help (class KTextEditor::View *, const QString &, QString &)
 
bool supportsRange (const QString &)
 

Static Public Member Functions

static bool parse (const QString &sedReplaceString, QString &destDelim, int &destFindBeginPos, int &destFindEndPos, int &destReplaceBeginPos, int &destReplaceEndPos)
 
static SedReplace * self ()
 

Detailed Description

Support vim/sed style search and replace.

Author
Charles Samuels charl.nosp@m.es@k.nosp@m.de.or.nosp@m.g

Definition at line 220 of file katecmds.h.

Constructor & Destructor Documentation

KateCommands::SedReplace::~SedReplace ( )
inline

Definition at line 226 of file katecmds.h.

Member Function Documentation

const QStringList& KateCommands::SedReplace::cmds ( )
inline

supported commands as prefixes

Returns
prefix list

Definition at line 257 of file katecmds.h.

bool KateCommands::SedReplace::exec ( class KTextEditor::View *  view,
const QString &  cmd,
QString &  errorMsg 
)

Execute command.

Valid command strings are:

  • s/search/replace/ find search, replace it with replace on this line
  • %s/search/replace/ do the same to the whole file
  • s/search/replace/i do the search and replace case insensitively
  • $s/search/replace/ do the search are replacement to the selection only
Note
$s/// is currently unsupported
Parameters
viewview to use for execution
cmdcmd string
errorMsgerror to return if no success
Returns
success

Definition at line 920 of file katecmds.cpp.

bool KateCommands::SedReplace::exec ( class KTextEditor::View *  view,
const QString &  cmd,
QString &  errorMsg,
const KTextEditor::Range &  r 
)

Definition at line 925 of file katecmds.cpp.

bool KateCommands::SedReplace::help ( class KTextEditor::View *  ,
const QString &  ,
QString &   
)
inline

This command does not have help.

See also
KTextEditor::Command::help

Definition at line 251 of file katecmds.h.

bool KateCommands::SedReplace::parse ( const QString &  sedReplaceString,
QString &  destDelim,
int &  destFindBeginPos,
int &  destFindEndPos,
int &  destReplaceBeginPos,
int &  destReplaceEndPos 
)
static

Parses sedReplaceString to see if it is a valid sed replace expression (e.g.

"s/find/replace/gi"). If it is, returns true and sets delimiter to the delimiter used in the expression; destFindBeginPos and destFindEndPos to the positions in * sedReplaceString of the begin and end of the "find" term; and destReplaceBeginPos and destReplaceEndPos to the begin and end positions of the "replace" term.

Definition at line 999 of file katecmds.cpp.

static SedReplace* KateCommands::SedReplace::self ( )
inlinestatic

Definition at line 259 of file katecmds.h.

bool KateCommands::SedReplace::supportsRange ( const QString &  )
inline

Definition at line 248 of file katecmds.h.


The documentation for this class was generated from the following files:
  • katecmds.h
  • katecmds.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:57:03 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Kate

Skip menu "Kate"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal