Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
P
Practical-Cryptdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Zhaozhen
Practical-Cryptdb
Commits
4e7dca04
Commit
4e7dca04
authored
Jan 10, 2018
by
yiwenshao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
able to construct onion levels in debug/read_onion_conf.cc
parent
9f6ae485
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
9 deletions
+23
-9
read_onion_conf.cc
debug/read_onion_conf.cc
+23
-9
No files found.
debug/read_onion_conf.cc
View file @
4e7dca04
...
...
@@ -3,6 +3,8 @@
#include <iostream>
#include <vector>
#include <map>
#include "util/onions.hh"
#include <assert.h>
using
namespace
std
;
class
onion_conf
{
...
...
@@ -16,6 +18,8 @@ class onion_conf{
void
read_onionlayout_num
(
std
::
string
temp
);
void
read_onionlayout_str
(
std
::
string
temp
);
public
:
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>&
get_onion_levels_num
(){
return
onions_for_num
;}
std
::
map
<
std
::
string
,
std
::
vector
<
std
::
string
>>&
get_onion_levels_str
(){
return
onions_for_str
;}
onion_conf
(
char
*
filename
);
~
onion_conf
();
};
...
...
@@ -40,21 +44,28 @@ std::vector<std::string> onion_conf::parseline(std::string temp){
void
onion_conf
::
read_onionlayout_num
(
std
::
string
temp
){
std
::
vector
<
std
::
string
>
res
=
parseline
(
temp
);
cout
<<
"for num"
<<
endl
;
for
(
auto
item
:
res
){
cout
<<
item
<<
":"
;
unsigned
int
i
=
1
;
assert
(
res
.
size
()
>
1
);
res
[
0
].
pop_back
();
std
::
string
onion_name
=
res
[
0
];
onions_for_str
[
onion_name
]
=
std
::
vector
<
std
::
string
>
();
for
(;
i
<
res
.
size
();
i
++
){
onions_for_str
[
onion_name
].
push_back
(
res
[
i
]);
}
cout
<<
endl
;
}
void
onion_conf
::
read_onionlayout_str
(
std
::
string
temp
){
std
::
vector
<
std
::
string
>
res
=
parseline
(
temp
);
cout
<<
"for str"
<<
endl
;
for
(
auto
item
:
res
){
cout
<<
item
<<
":"
;
}
cout
<<
endl
;
unsigned
int
i
=
1
;
assert
(
res
.
size
()
>
1
);
res
[
0
].
pop_back
();
std
::
string
onion_name
=
res
[
0
];
onions_for_num
[
onion_name
]
=
std
::
vector
<
std
::
string
>
();
for
(;
i
<
res
.
size
();
i
++
){
onions_for_num
[
onion_name
].
push_back
(
res
[
i
]);
}
}
onion_conf
::
onion_conf
(
char
*
f
=
(
char
*
)
"onionlayout.conf"
){
...
...
@@ -98,5 +109,8 @@ onion_conf::~onion_conf(){
int
main
(){
onion_conf
of
;
auto
res1
=
of
.
get_onion_levels_num
();
auto
res2
=
of
.
get_onion_levels_str
();
return
0
;
}
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