📄 substrin.h
字号:
#pragma SubString
const unsigned int first=0, last = 0xFFFF;
/* All of the following strings are indexed from 0 to 65535. */
unsigned int LengthS(char &s[], unsigned int start, unsigned int N);
/* Returns the length of a substring of string "s". The substring is specified
by a starting position "start" within string "s", and a given length "N".
If the length of the substring is greater than the remaining chars in "s"
then the number of the remaining chars is returned. */
unsigned int OccursCS (char &left[], unsigned int start, unsigned int N,
char right[]);
/* Checks whether string "right" occurs within a substring of string left.
The substring begins at position "start" and is of "N" chars long.
If "right" string occurs within the substring of "left", then the relative
(to "start") position is given, else SubString.last is returned. */
unsigned int OccursSS (char &left[], unsigned int lstart, unsigned int lN,
char &right[], unsigned int rstart, unsigned int rN);
/* Checks whether a substring of "right" - beginning at "rstart" and of "rN"
length - occurs within a substring of "left" - beginning at "lstart" and
of "lN" length -. The starting position of the "right" substring within the
"left" substring is returned or, if failure, SubString.last is returned.*/
void InsertCS(char &s[], unsigned int lstart, unsigned int lN,
char w[], unsigned int at);
/* Inserts string "w" within a substring of "s", at position "at" in the
substring. In case the limits of string "s" are exceeded, then the
appropriate message is printed. */
void InsertSS(char &s[], char &w[], unsigned int lstart, unsigned int lN, unsigned int rstart, unsigned int rN, unsigned int at);
/* Insert a substring of "w" - starting at "rstart", of "rN" length - into a
substring of "s" - starting at "lstart", of "lN" length -, at position "at".
Again, if certain limits within strings are exceeded, then the appropriate
message is printed. */
void DeleteS(char &s[], unsigned int lstart, unsigned int lN, unsigned int at, unsigned int N);
/* Deletes - within a substring of "s" - a range of chars at position "at"
and of length "N".If "at"="last", deletion is at end of string; otherwise,
deletes from at-1 to at-N. "at" is relative to lstart. */
void CopyCS(char &dest[], unsigned int start, unsigned int N,
char source[]);
/* Copies a substring of string "source" into a substring of string "dest".
The substring within "dest" is specified by the starting position "start"
and by its length "N". */
void CopySS(char &dest[], unsigned int dStart, unsigned int dN,
char &source[], unsigned int sStart, unsigned int sN);
/* Substitutes a substring of string "dest" with a same length substring of
substring "source". Each string is specified by its starting position
- "dstart" and "sstart" respectively - and its length - "dN" and "sN"
respectively. */
int CompareCS(char &left[], unsigned int start, unsigned int N,
char right[]);
/* Compares a substring of the string "left" to the string "right". If the
two strings are equal, "0" is returned, else the position of the first
different character is returned. If the position is negative, left<right
and the ABS() value is the position of difference. */
int CompareSS(char &left[], unsigned int lstart, unsigned int lN,
char &right[], unsigned int rstart, unsigned int rN);
/* Compares the two specified substrings of strings "left" and "right" and
returns "0" if the two substrings are equal, or it returns
the position of first difference.If the position is negative, left<right
and the ABS() value is the position of difference. */
void FillCS(char &dest[], unsigned int lstart, unsigned int lN,
char source[], unsigned int N);
/* Fills the part of string "dest" beginning at position "lstart" and
extending to the next "lN" chars with the string "source", provided
that string "source" fits into the given range within "dest". */
void FillSS(char &dest[], unsigned int lstart, unsigned int lN,
char &right[], unsigned int rstart, unsigned int rN, unsigned int N);
/* Fills the part of string "dest" beginning at position "lstart" and
extending to the next "lN" chars with the substring of "source"
- specified by "rstart" and "rN" - provided that the substring fits in the
given range within "dest". */
void FillField(char &dest[], unsigned int start, unsigned int N, char ch);
/* Substitutes a substring of "dest" with an equal length string constructed
of the same given char : "ch".
Used to blank trailing portions of fixed-width fields for record output.
Stores ch over the 0C terminator character through the end of the field.
Also used because Delete does fill with trailing nulls. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -