FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
lpython/src/libasr/string_utils.h at main · Viocid/lpython · GitHub
Viocid
/
lpython
Public
forked from
lcompilers/lpython
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
lpython
/
src
/
libasr
/
string_utils.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
50 lines (38 loc) · 1.74 KB
Breadcrumbs
lpython
/
src
/
libasr
/
string_utils.h
Copy path
File metadata and controls
50 lines (38 loc) · 1.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#
ifndef
LFORTRAN_STRING_UTILS_H
#
define
LFORTRAN_STRING_UTILS_H
#
include
<
string
>
#
include
<
vector
>
#
include
<
cctype
>
#
include
<
libasr/alloc.h
>
#
include
<
libasr/containers.h
>
namespace
LCompilers
{
bool
startswith
(
const
std::string &s,
const
std::string &e);
bool
endswith
(
const
std::string &s,
const
std::string &e);
std::string
to_lower
(
const
std::string &s);
std::vector<std::string>
string_split
(
const
std::string &s,
const
std::string &split_string);
std::vector<std::string>
split
(
const
std::string &s);
std::string
join
(
const
std::string j,
const
std::vector<std::string> &v);
std::vector<std::string>
slice
(
const
std::vector<std::string> &v,
int
start=
0
,
int
end=-
1
);
char
*
s2c
(Allocator &al,
const
std::string &s);
//
Replaces all occurrences of `regex` (a regular expression, must escape
//
special characters) with `replace`
std::string
replace
(
const
std::string &s,
const
std::string ®ex,
const
std::string &replace);
std::string
read_file
(
const
std::string &filename);
//
Returns the parent path to the given path
std::string
parent_path
(
const
std::string &path);
//
Returns true if the path is relative
bool
is_relative_path
(
const
std::string &path);
//
Joins paths (paths can be empty)
std::string
join_paths
(
const
std::vector<std::string> &paths);
//
Escapes special characters from the given string
//
using C style escaping
std::string
str_escape_c
(
const
std::string &s);
char
*
str_unescape_c
(Allocator &al, LCompilers::Str &s);
//
Escapes double quote characters from the given string
//
given string must be enclosed in double quotes
std::string
str_escape_fortran_double_quote
(
const
std::string &s);
char
*
str_unescape_fortran
(Allocator &al, LCompilers::Str &s,
char
ch);
}
//
namespace LCompilers
#
endif
//
LFORTRAN_STRING_UTILS_H
Back
|
FazBrowse Home
|
New Git URL