Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
K
KWSys
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Martin Willers
KWSys
Commits
6d90ac66
Commit
6d90ac66
authored
20 years ago
by
Sebastien Barre
Browse files
Options
Downloads
Patches
Plain Diff
ENH: add last two small funcs from vtkString. Done removing deps
parent
bd1ebbd4
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
SystemTools.cxx
+49
-0
49 additions, 0 deletions
SystemTools.cxx
SystemTools.hxx.in
+11
-0
11 additions, 0 deletions
SystemTools.hxx.in
with
60 additions
and
0 deletions
SystemTools.cxx
+
49
−
0
View file @
6d90ac66
...
...
@@ -841,6 +841,55 @@ kwsys_stl::string SystemTools::AddSpaceBetweenCapitalizedWords(
return
n
;
}
char
*
SystemTools
::
AppendStrings
(
const
char
*
str1
,
const
char
*
str2
)
{
if
(
!
str1
)
{
return
SystemTools
::
DuplicateString
(
str2
);
}
if
(
!
str2
)
{
return
SystemTools
::
DuplicateString
(
str1
);
}
size_t
len1
=
strlen
(
str1
);
char
*
newstr
=
new
char
[
len1
+
strlen
(
str2
)
+
1
];
if
(
!
newstr
)
{
return
0
;
}
strcpy
(
newstr
,
str1
);
strcat
(
newstr
+
len1
,
str2
);
return
newstr
;
}
char
*
SystemTools
::
AppendStrings
(
const
char
*
str1
,
const
char
*
str2
,
const
char
*
str3
)
{
if
(
!
str1
)
{
return
SystemTools
::
AppendStrings
(
str2
,
str3
);
}
if
(
!
str2
)
{
return
SystemTools
::
AppendStrings
(
str1
,
str3
);
}
if
(
!
str3
)
{
return
SystemTools
::
AppendStrings
(
str1
,
str2
);
}
size_t
len1
=
strlen
(
str1
),
len2
=
strlen
(
str2
);
char
*
newstr
=
new
char
[
len1
+
len2
+
strlen
(
str3
)
+
1
];
if
(
!
newstr
)
{
return
0
;
}
strcpy
(
newstr
,
str1
);
strcat
(
newstr
+
len1
,
str2
);
strcat
(
newstr
+
len1
+
len2
,
str3
);
return
newstr
;
}
// Return a lower case string
kwsys_stl
::
string
SystemTools
::
LowerCase
(
const
kwsys_stl
::
string
&
s
)
{
...
...
This diff is collapsed.
Click to expand it.
SystemTools.hxx.in
+
11
−
0
View file @
6d90ac66
...
...
@@ -177,6 +177,17 @@ public:
static kwsys_stl::string AddSpaceBetweenCapitalizedWords(
const kwsys_stl::string&);
/**
* Append two or more strings and produce new one.
* Programmer must 'delete []' the resulting string, which was allocated
* with 'new'.
* Return 0 if inputs are empty or there was an error
*/
static char* AppendStrings(
const char* str1, const char* str2);
static char* AppendStrings(
const char* str1, const char* str2, const char* str3);
/** -----------------------------------------------------------------
* Filename Manipulation Routines
* -----------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment