YaST2 Developers Documentation: AsciiFile.ycp



functions
files
intro

AsciiFile.ycp

  • Thomas Fehr <fehr@suse.de>
  • Purpose: Handle reading and modifying of ascii files.

Global Functions

Local Functions

global SetComment (map& file, string comment) -> void

Sets the string how the comment starts

Parameters:
file
comment

global SetListWidth (map& file, list widths) -> void

Sets the widths of records on one line

Parameters:
file
widths

global SetDelimiter (map& file, string delim) -> void

Sets the delimiter between the records on one line

Parameters:
file
delim

local AssertLineValid (map& file, integer line) -> string

Private function

Parameters:
file
line

global ReadFile (map& file, string pathname) -> void

Reads the file from the disk

Parameters:
file
pathname

global FindLineField (map file, integer field, string content) -> list<integer>

Returns the list of rows where matches searched string in the defined column

Parameters:
file
field
content
Return value:
matching rows

global GetLines (map& file, list<integer> lines) -> map<integer, map>

Returns map of wanted lines

Parameters:
file
lines
Return value:
with wanted lines

global GetLine (map& file, integer line) -> map

Returns map of wanted line

Parameters:
file
line
Return value:
of wanted line

global NumLines (map file) -> integer

Returns count of lines in file

Parameters:
file
Return value:
count of lines

global ChangeLineField (map& file, integer line, integer field, string entry) -> void

Changes the record in the file defined by row and column

Parameters:
file
line
field
entry

global ReplaceLine (map& file, integer line, list<string> entry) -> void

Changes a complete line

Parameters:
file
line
entry

global AppendLine (map& file, list entry) -> void

Appends a new line at the bottom

Parameters:
file
entry

global RemoveLines (map& file, list<integer> lines) -> void

Removes lines

Parameters:
file
lines

global RewriteFile (map& file, string fpath) -> void

Writes a content into the file

Parameters:
file
fpath

YaST2 Developers Documentation