|
GRASS GIS 7 Programmer's Manual
7.8.2(2019)-exported
|
GIS Library - Find raster map. More...
#include <string.h>#include <stdlib.h>#include <ctype.h>#include <sys/types.h>#include <grass/gis.h>
Go to the source code of this file.
Macros | |
| #define | NULL 0 |
Functions | |
| int | G_strcasecmp (const char *x, const char *y) |
| String compare ignoring case (upper or lower) More... | |
| int | G_strncasecmp (const char *x, const char *y, int n) |
| String compare ignoring case (upper or lower) - limited number of characters. More... | |
| char * | G_store (const char *s) |
| Copy string to allocated memory. More... | |
| char * | G_store_upper (const char *s) |
| Copy string to allocated memory and convert copied string to upper case. More... | |
| char * | G_store_lower (const char *s) |
| Copy string to allocated memory and convert copied string to lower case. More... | |
| char * | G_strchg (char *bug, char character, char new) |
| Replace all occurrences of character in string bug with new. More... | |
| char * | G_str_replace (const char *buffer, const char *old_str, const char *new_str) |
| Replace all occurrences of old_str in buffer with new_str. More... | |
| void | G_strip (char *buf) |
| Removes all leading and trailing white space from string. More... | |
| char * | G_chop (char *line) |
| Chop leading and trailing white spaces. More... | |
| void | G_str_to_upper (char *str) |
| Convert string to upper case. More... | |
| void | G_str_to_lower (char *str) |
| Convert string to lower case. More... | |
| int | G_str_to_sql (char *str) |
| Make string SQL compliant. More... | |
| void | G_squeeze (char *line) |
| Remove superfluous white space. More... | |
| char * | G_strcasestr (const char *str, const char *substr) |
| Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lower) More... | |
GIS Library - Find raster map.
GIS Library - string/chring movement functions.
(C) 1999-2009 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
(C) 1999-2008, 2011 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file strings.c.
| char* G_chop | ( | char * | line | ) |
Chop leading and trailing white spaces.
space, \f, \n, \r, \t, \v
Modified copy of G_squeeze() by RB in March 2000.
| line | buffer to be worked on |
Definition at line 286 of file strings.c.
Referenced by check_create_export_opts(), check_create_import_opts(), check_mapset_in_layer_name(), G_str_to_color(), and read_coor().
| void G_squeeze | ( | char * | line | ) |
Remove superfluous white space.
Leading and trailing white space is removed from the string line and internal white space which is more than one character is reduced to a single space character. White space here means spaces, tabs, linefeeds, newlines, and formfeeds.
| [in,out] | line |
| char* G_store | ( | const char * | s | ) |
Copy string to allocated memory.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
| s | string |
Definition at line 86 of file strings.c.
Referenced by cairo_read_ppm(), cairo_write_ppm(), G__read_Cell_head(), G_add_keyword(), G_config_path(), G_fully_qualified_name(), G_get_available_mapsets(), G_ls2(), G_myname(), G_option_to_separator(), G_parser(), G_putenv(), G_str_replace(), GPJ__get_datum_params(), GPJ_get_datum_by_name(), GPJ_get_default_datum_params_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_get_equivalent_latlong(), GPJ_init_transform(), GPJ_osr_to_grass(), M__add_element(), read_pgm(), and write_pgm().
| char* G_store_lower | ( | const char * | s | ) |
Copy string to allocated memory and convert copied string to lower case.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
| s | string |
| char* G_store_upper | ( | const char * | s | ) |
Copy string to allocated memory and convert copied string to upper case.
This routine allocates enough memory to hold the string s, copies s to the allocated memory, and returns a pointer to the allocated memory.
If s is NULL then empty string is returned.
| s | string |
Definition at line 116 of file strings.c.
Referenced by GPJ_init_transform().
| char* G_str_replace | ( | const char * | buffer, |
| const char * | old_str, | ||
| const char * | new_str | ||
| ) |
| void G_str_to_lower | ( | char * | str | ) |
| int G_str_to_sql | ( | char * | str | ) |
| void G_str_to_upper | ( | char * | str | ) |
| int G_strcasecmp | ( | const char * | x, |
| const char * | y | ||
| ) |
String compare ignoring case (upper or lower)
Returning a value that has the same sign as the difference between the first differing pair of characters.
Note: strcasecmp() is affected by the locale (LC_CTYPE), while G_strcasecmp() isn't.
| x | first string to compare |
| y | second string to compare |
Definition at line 46 of file strings.c.
Referenced by AS_option_to_algorithm(), Cairo_Graph_set(), check_mapset_in_layer_name(), clean_dir(), G_compressor_number(), G_str_to_color(), GPJ_get_datum_by_name(), GPJ_get_ellipsoid_by_name(), GPJ_osr_to_grass(), M_do_copy(), M_do_remove(), M_do_rename(), M_get_element(), PNG_Graph_set(), read_image(), and write_image().
| char* G_strcasestr | ( | const char * | str, |
| const char * | substr | ||
| ) |
Finds the first occurrence of the sub-string in the null-terminated string ignoring case (upper or lower)
| str | string where to find sub-string |
| substr | sub-string |
Definition at line 430 of file strings.c.
References G_strncasecmp(), and NULL.
| char* G_strchg | ( | char * | bug, |
| char | character, | ||
| char | new | ||
| ) |
| void G_strip | ( | char * | buf | ) |
| int G_strncasecmp | ( | const char * | x, |
| const char * | y, | ||
| int | n | ||
| ) |
String compare ignoring case (upper or lower) - limited number of characters.
Returning a value that has the same sign as the difference between the first differing pair of characters.
Note: strcasecmp() is affected by the locale (LC_CTYPE), while G_strcasecmp() isn't.
| x | first string to compare |
| y | second string to compare |
| n | number or characters to compare |
Definition at line 68 of file strings.c.
Referenced by check_create_export_opts(), check_create_import_opts(), and G_strcasestr().