#include <unistd.h>#include <ctype.h>#include <stdio.h>#include <regex.h>#include <libintl.h>#include <iostream>#include <string>#include "ycp/YCPBuiltinString.h"#include "ycp/YCPString.h"#include "ycp/YCPInteger.h"#include "ycp/YCPPath.h"#include "ycp/YCPSymbol.h"#include "ycp/YCPBoolean.h"#include "ycp/YCPVoid.h"#include "ycp/y2log.h"#include "y2string.h"#include "y2crypt.h"#include "ycp/StaticDeclaration.h"Defines | |
| #define | _XOPEN_SOURCE |
| #define | _GNU_SOURCE |
| #define | ERR_MAX 80 |
| #define | SUB_MAX 10 |
Typedefs | |
| typedef REG_RET | Reg_Ret |
| Searches the last element of string that doesn't match. | |
Functions | |
| static YCPValue | s_size (const YCPString &s) |
| static YCPValue | s_plus1 (const YCPString &s1, const YCPString &s2) |
Returns the number of characters of the string s. | |
| static YCPValue | s_plus2 (const YCPString &s1, const YCPInteger &i2) |
| static YCPValue | s_plus3 (const YCPString &s1, const YCPPath &p2) |
| String and integer Concatenation. | |
| static YCPValue | s_plus4 (const YCPString &s1, const YCPSymbol &s2) |
String and path Concatenation Returns concatenation of s1 and p2 after transforming p2 to a string. | |
| static YCPValue | s_issubstring (const YCPString &target, const YCPString &sub) |
| String and symbol Concatenation. | |
| static YCPValue | s_tohexstring (const YCPInteger &i) |
| searches for a specific string within another string | |
| static YCPValue | s_substring1 (const YCPString &s, const YCPInteger &i1) |
| Converts a integer to a hexadecimal string. | |
| static YCPValue | s_substring2 (const YCPString &s, const YCPInteger &i1, const YCPInteger &i2) |
| Return part of a string. | |
| static YCPValue | s_find (const YCPString &s1, const YCPString &s2) |
| Extract a substring. | |
| static YCPValue | s_tolower (const YCPString &s) |
| Return position of a substring. | |
| static YCPValue | s_toupper (const YCPString &s) |
| Make a string lowercase. | |
| static YCPValue | s_toascii (const YCPString &s) |
| Make a string uppercase. | |
| static YCPValue | s_removechars (const YCPString &s, YCPString &r) |
Returns characters below 0x7F included in STRING. | |
| static YCPValue | s_filterchars (const YCPString &s, const YCPString &i) |
| Removes all characters from a string. | |
| static YCPValue | s_mergestring (const YCPList &l, const YCPString &s) |
| Filter charachters out of a String. | |
| static YCPValue | s_findfirstnotof (const YCPString &s1, const YCPString &s2) |
| Join list elements with a string. | |
| static YCPValue | s_findfirstof (const YCPString &s1, const YCPString &s2) |
| Search string for first non matching chars. | |
| static YCPValue | s_findlastof (const YCPString &s1, const YCPString &s2) |
| Find position of first matching charachters in string. | |
| static YCPValue | s_findlastnotof (const YCPString &s1, const YCPString &s2) |
| Searches string for the last match The `findlastof' function searches string for the last match of any character stored in chars and returns its position. | |
| Reg_Ret | solve_regular_expression (const char *input, const char *pattern, const char *result) |
| static YCPValue | s_regexpmatch (const YCPString &i, const YCPString &p) |
| static YCPValue | s_regexppos (const YCPString &inp, const YCPString &pat) |
| Searches a string for a POSIX Extended Regular Expression match. | |
| static YCPValue | s_regexpsub (const YCPString &i, const YCPString &p, const YCPString &m) |
| Returns a pair with position and length of the first match. | |
| static YCPValue | s_regexptokenize (const YCPString &i, const YCPString &p) |
| Regex Substitution. | |
| static YCPValue | s_tostring (const YCPValue &v) |
| Regex tokenize. | |
| static YCPValue | s_timestring (const YCPString &fmt, const YCPInteger &time, const YCPBoolean &utc_flag) |
| Converts a value to a string. | |
| static YCPValue | s_crypt (const YCPString &s) |
| Return time string Combination of standard libc functions gmtime or localtime and strftime. | |
| static YCPValue | s_cryptmd5 (const YCPString &s) |
Encrypt a string Encrypt the string UNENCRYPTED using the standard password encryption provided by the system. | |
| static YCPValue | s_cryptbigcrypt (const YCPString &original) |
Encrypt a string using md5 Encrypt the string UNENCRYPTED using md5 password encryption. | |
| static YCPValue | s_cryptblowfish (const YCPString &original) |
Encrypt a string using bigcrypt Encrypt the string UNENCRYPTED using bigcrypt password encryption. The password is not truncated. | |
| static YCPValue | s_dgettext (const YCPString &domain, const YCPString &text) |
Encrypt a string with blowfish Encrypt the string UNENCRYPTED using blowfish password encryption. The password is not truncated. | |
| static YCPValue | s_dngettext (const YCPString &domain, const YCPString &singular, const YCPString &plural, const YCPInteger &count) |
| Translates the text using the given text domain Translates the text using the given text domain into the current language. | |
Variables | |
| StaticDeclaration | static_declarations |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Searches the last element of string that doesn't match.
|
|
|
Return time string Combination of standard libc functions gmtime or localtime and strftime. crypt
|
|
|
Encrypt a string using md5 Encrypt the string cryptbigcrypt
|
|
|
Encrypt a string using bigcrypt Encrypt the string cryptblowfish
|
|
|
Encrypt a string Encrypt the string cryptmd5
|
|
||||||||||||
|
Encrypt a string with blowfish Encrypt the string _(string text) -> string Translates the text using the current textdomain. Example
_("File") -> "Soubor"
dgettext This is a special case builtin not intended for general use. See _() instead.
|
|
||||||||||||||||||||
|
Translates the text using the given text domain Translates the text using the given text domain into the current language.
_(string singular, string plural, integer value) -> string Translates the text using a locale-aware plural form handling and the current textdomain. The chosen form of the translation depends on the Example
_("%1 File", "%1 Files", 2) -> "%1 soubory"
dngettext
The chosen form of the translation depend on the This is a special case builtin not intended for general use. See _() instead.
|
|
||||||||||||
|
Removes all characters from a string. filterchars
STRING by removing all characters that do not occur in CHARS.
|
|
||||||||||||
|
Extract a substring. find
The
Returns the first position in
|
|
||||||||||||
|
Join list elements with a string. findfirstnotof
findfirstnotof function searches the first element of string that doesn't match any character stored in chars and returns its position.
|
|
||||||||||||
|
Search string for first non matching chars. findfirstof
findfirstof function searches string for the first match of any character stored in chars and returns its position.If no match is found findfirstof returns `nil'.
|
|
||||||||||||
|
Searches string for the last match The `findlastof' function searches string for the last match of any character stored in chars and returns its position. findlastnotof
|
|
||||||||||||
|
Find position of first matching charachters in string. findlastof
|
|
||||||||||||
|
String and symbol Concatenation. issubstring
|
|
||||||||||||
|
Filter charachters out of a String. mergestring
List elements which are not of type strings are ignored.
|
|
||||||||||||
|
Returns the number of characters of the string
string s1 + string s2 -> string Returns concatenation of Example: "YaST" + "2" -> "YaST2" |
|
||||||||||||
|
string s1 + integer i2 -> string
Returns concatenation of Example:
|
|
||||||||||||
|
String and integer Concatenation. string s1 + path p2 -> string
Example: |
|
||||||||||||
|
String and path Concatenation Returns concatenation of string s1 + symbol s2 -> string
Returns concatenation of
Example: |
|
||||||||||||
|
regexpmatch
|
|
||||||||||||
|
Searches a string for a POSIX Extended Regular Expression match. regexppos
|
|
||||||||||||||||
|
Returns a pair with position and length of the first match. regexpsub
|
|
||||||||||||
|
Regex Substitution. regexptokenize
If the pattern is invalid, 'nil' is returned. Examples: // e == [ "aaabbB" ] list e = regexptokenize ("aaabbBb", "(.*[A-Z]).*"); // h == [ "aaab", "bb" ] list h = regexptokenize ("aaabbb", "(.*ab)(.*)"); // h == [] list h = regexptokenize ("aaabbb", "(.*ba).*"); // h == nil list h = regexptokenize ("aaabbb", "(.*ba).*("); |
|
||||||||||||
|
Returns characters below 0x7F included in deletechars
STRING by removing all characters that occur in string REMOVE.
|
|
|
size
size("size") -> 4 |
|
||||||||||||
|
Converts a integer to a hexadecimal string. substring substring_1
STRING specified by the OFFSET and LENGHT parameters. OFFSET starts with 0.substring ("some text", 5) -> "text" substring ("some text", 42) -> "" substring ("some text", 5, 2) -> "te" substring ("some text", 42, 2) -> "" substring("123456789", 2, 3) -> "345" |
|
||||||||||||||||
|
Return part of a string. substring substring_2
Extracts a substring of the string
|
|
||||||||||||||||
|
Converts a value to a string. timestring
|
|
|
Make a string uppercase. toascii
STRING by copying each character that is below 0x7F (127).toascii ("aBë") -> "aB" toascii ("123+-abcABCöëä") -> "123+-abcABC" |
|
|
searches for a specific string within another string tohexstring
tohexstring (31) -> "0x1f" |
|
|
Return position of a substring. tolower
tolower ("aBcDeF") -> "abcdef" tolower ("ABCÁÄÖČ") -> "abcÁÄÖČ" |
|
|
Regex tokenize. tostring
|
|
|
Make a string lowercase. toupper Returns string with all alphabetic characters converted to uppercase.
|
|
||||||||||||||||
|
|
|
|
|
1.4.1