Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
29591e86
Commit
29591e86
authored
Mar 11, 2009
by
Rémi Duraffort
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
skins2: operator '=' return a reference.
parent
7768ff9e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
5 deletions
+15
-5
modules/gui/skins2/utils/ustring.cpp
modules/gui/skins2/utils/ustring.cpp
+13
-3
modules/gui/skins2/utils/ustring.hpp
modules/gui/skins2/utils/ustring.hpp
+2
-2
No files found.
modules/gui/skins2/utils/ustring.cpp
View file @
29591e86
...
...
@@ -199,8 +199,11 @@ bool UString::operator >=( const UString &rOther ) const
}
void
UString
::
operator
=
(
const
UString
&
rOther
)
UString
&
UString
::
operator
=
(
const
UString
&
rOther
)
{
if
(
this
==
&
rOther
)
return
*
this
;
m_length
=
rOther
.
m_length
;
delete
[]
m_pString
;
m_pString
=
new
uint32_t
[
size
()
+
1
];
...
...
@@ -208,15 +211,20 @@ void UString::operator =( const UString &rOther )
{
m_pString
[
i
]
=
rOther
.
m_pString
[
i
];
}
return
*
this
;
}
void
UString
::
operator
+=
(
const
UString
&
rOther
)
UString
&
UString
::
operator
+=
(
const
UString
&
rOther
)
{
if
(
this
==
&
rOther
)
return
*
this
;
int
tempLength
=
this
->
length
()
+
rOther
.
length
();
uint32_t
*
pTempString
=
new
uint32_t
[
tempLength
+
1
];
// Copy the first string
memcpy
(
pTempString
,
this
->
m_pString
,
4
*
this
->
size
()
);
memcpy
(
pTempString
,
this
->
m_pString
,
sizeof
(
uint32_t
)
*
this
->
size
()
);
// Append the second string
// memcpy( pTempString + 4 * size(), rOther.m_pString,
// 4 * rOther.size() );
...
...
@@ -230,6 +238,8 @@ void UString::operator +=( const UString &rOther )
delete
[]
m_pString
;
m_pString
=
pTempString
;
m_length
=
tempLength
;
return
*
this
;
}
...
...
modules/gui/skins2/utils/ustring.hpp
View file @
29591e86
...
...
@@ -58,9 +58,9 @@ class UString: public SkinObject
bool
operator
>
(
const
UString
&
rOther
)
const
;
bool
operator
>=
(
const
UString
&
rOther
)
const
;
/// Assignment
void
operator
=
(
const
UString
&
rOther
);
UString
&
operator
=
(
const
UString
&
rOther
);
/// Concatenation with assignment
void
operator
+=
(
const
UString
&
rOther
);
UString
&
operator
+=
(
const
UString
&
rOther
);
/// Concatenation
const
UString
operator
+
(
const
UString
&
rOther
)
const
;
const
UString
operator
+
(
const
char
*
pString
)
const
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment