Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
WCCL
Manage
Activity
Members
Labels
Plan
Issues
4
Issue boards
Milestones
Wiki
Redmine
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Analysers
WCCL
Commits
a8e45b48
Commit
a8e45b48
authored
14 years ago
by
ilor
Browse files
Options
Downloads
Patches
Plain Diff
add UnicodeString variants of to_raw_string and to_string to Value
parent
2253e762
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libwccl/values/strset.cpp
+17
-0
17 additions, 0 deletions
libwccl/values/strset.cpp
libwccl/values/strset.h
+3
-0
3 additions, 0 deletions
libwccl/values/strset.h
libwccl/values/value.h
+14
-0
14 additions, 0 deletions
libwccl/values/value.h
with
34 additions
and
0 deletions
libwccl/values/strset.cpp
+
17
−
0
View file @
a8e45b48
...
...
@@ -23,6 +23,23 @@ std::string StrSet::to_raw_string() const
return
ss
.
str
();
}
UnicodeString
StrSet
::
to_raw_string_u
()
const
{
UnicodeString
u
;
u
.
append
(
UNICODE_STRING
(
"["
,
1
));
value_type
::
const_iterator
it
=
set_
.
begin
();
while
(
it
!=
set_
.
end
())
{
u
.
append
(
UNICODE_STRING
(
"
\"
"
,
1
));
u
.
append
(
*
it
);
//TODO escaping
u
.
append
(
UNICODE_STRING
(
"
\"
"
,
1
));
if
(
++
it
!=
set_
.
end
())
{
u
.
append
(
UNICODE_STRING
(
", "
,
2
));
}
}
u
.
append
(
UNICODE_STRING
(
"]"
,
1
));
return
u
;
}
bool
StrSet
::
intersects
(
const
StrSet
&
other
)
const
{
if
(
empty
()
||
other
.
empty
())
{
return
false
;
...
...
This diff is collapsed.
Click to expand it.
libwccl/values/strset.h
+
3
−
0
View file @
a8e45b48
...
...
@@ -96,6 +96,9 @@ public:
/// Value override
std
::
string
to_raw_string
()
const
;
/// Value override
UnicodeString
to_raw_string_u
()
const
;
private
:
value_type
set_
;
};
...
...
This diff is collapsed.
Click to expand it.
libwccl/values/value.h
+
14
−
0
View file @
a8e45b48
...
...
@@ -49,6 +49,13 @@ public:
return
to_raw_string
();
}
/**
* Unicode variant of to_string
*/
virtual
UnicodeString
to_string_u
(
const
Corpus2
::
Tagset
&
/*tagset*/
)
const
{
return
to_raw_string_u
();
}
/**
* String representation of the Value that does not require a tagset,
* might be incomplete and/or contain internal info.
...
...
@@ -57,6 +64,13 @@ public:
*/
virtual
std
::
string
to_raw_string
()
const
=
0
;
/**
* Unicode variant of to_raw_string
*/
virtual
UnicodeString
to_raw_string_u
()
const
{
return
UnicodeString
::
fromUTF8
(
to_raw_string
());
}
protected
:
Value
()
{}
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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