Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tnl-dev
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
TNL
tnl-dev
Commits
955e99f0
There was an error fetching the commit references. Please try again later.
Commit
955e99f0
authored
6 years ago
by
Nina Džugasová
Browse files
Options
Downloads
Patches
Plain Diff
Added first examples into String.
parent
1704a0cb
No related branches found
No related tags found
1 merge request
!15
Nina
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/TNL/String.h
+14
-22
14 additions, 22 deletions
src/TNL/String.h
with
14 additions
and
22 deletions
src/TNL/String.h
+
14
−
22
View file @
955e99f0
...
@@ -25,7 +25,13 @@ class String;
...
@@ -25,7 +25,13 @@ class String;
template
<
typename
T
>
template
<
typename
T
>
String
convertToString
(
const
T
&
value
);
String
convertToString
(
const
T
&
value
);
/////
/// \brief Class for managing strings.
///
/// \par Example
/// \include StringExample.cpp
/// \par Output
/// \include StringOutput.cpp
class
String
class
String
{
{
public:
public:
...
@@ -34,10 +40,6 @@ class String
...
@@ -34,10 +40,6 @@ class String
/// \brief Basic constructor.
/// \brief Basic constructor.
///
///
/// Constructs an empty string object with the length of zero characters.
/// Constructs an empty string object with the length of zero characters.
/// \par Example
/// \include StringExample.cpp
/// \par Output
/// str1 = \n str2 =
String
();
String
();
/////
/////
...
@@ -51,12 +53,6 @@ class String
...
@@ -51,12 +53,6 @@ class String
/// to be omitted from the string \e c.
/// to be omitted from the string \e c.
/// @param sufix_cut_off Determines the length of the sufix that is going
/// @param sufix_cut_off Determines the length of the sufix that is going
/// to be omitted from the string \e c.
/// to be omitted from the string \e c.
///
/// \par Example
/// \code String str( "xxstringxxx", 2, 3 ); \endcode
///
/// \par Output
/// str = string
String
(
const
char
*
c
,
String
(
const
char
*
c
,
int
prefix_cut_off
=
0
,
int
prefix_cut_off
=
0
,
int
sufix_cut_off
=
0
);
int
sufix_cut_off
=
0
);
...
@@ -73,17 +69,12 @@ class String
...
@@ -73,17 +69,12 @@ class String
/// \brief Copy constructor.
/// \brief Copy constructor.
///
///
/// Constructs a copy of the string \e str.
/// Constructs a copy of the string \e str.
///
/// \par Example
/// \code
String
str1
(
"Something"
);
String
str2
(
str1
);
/// \endcode
/// \par Output
/// str1 = Something \n str2 = Something
String
(
const
String
&
str
);
String
(
const
String
&
str
);
/// Converts anything to a string.
/// \brief Converts anything to a string.
///
/// This function converts any type of value into type string.
/// @param value Word of any type (e.g. int, bool, double,...).
template
<
typename
T
>
template
<
typename
T
>
String
(
T
value
)
String
(
T
value
)
:
string
(
nullptr
),
length
(
0
)
:
string
(
nullptr
),
length
(
0
)
...
@@ -106,6 +97,7 @@ class String
...
@@ -106,6 +97,7 @@ class String
/////
/////
/// Reserves space for given \e size.
/// Reserves space for given \e size.
/// Requests to allocate storage for given \e size.
/// Requests to allocate storage for given \e size.
/// It allocates one more byte for the terminating 0.
/// @param size Number of characters.
/// @param size Number of characters.
void
setSize
(
int
size
);
void
setSize
(
int
size
);
...
@@ -264,7 +256,7 @@ class String
...
@@ -264,7 +256,7 @@ class String
bool
load
(
File
&
file
);
bool
load
(
File
&
file
);
// Mozem dat prec???
!!!!
//
!!!
Mozem dat prec???
// Broadcast to other nodes in MPI cluster
// Broadcast to other nodes in MPI cluster
// void MPIBcast( int root, MPI_Comm mpi_comm = MPI_COMM_WORLD );
// void MPIBcast( int root, MPI_Comm mpi_comm = MPI_COMM_WORLD );
...
@@ -286,7 +278,7 @@ class String
...
@@ -286,7 +278,7 @@ class String
/// Length of allocated piece of memory.
/// Length of allocated piece of memory.
int
length
;
int
length
;
};
};
// class String
/// Returns concatenation of \e string1 and \e string2.
/// Returns concatenation of \e string1 and \e string2.
String
operator
+
(
char
string1
,
const
String
&
string2
);
String
operator
+
(
char
string1
,
const
String
&
string2
);
...
...
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