Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
J
jami-daemon
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
145
Issues
145
List
Boards
Labels
Service Desk
Milestones
Iterations
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
savoirfairelinux
jami-daemon
Commits
92c996dc
Commit
92c996dc
authored
Jul 07, 2010
by
Alexandre Savard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[#3649] Pass emitter as an argument for serialization
parent
455ae5be
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
40 additions
and
12 deletions
+40
-12
sflphone-common/src/account.h
sflphone-common/src/account.h
+1
-1
sflphone-common/src/config/serializable.h
sflphone-common/src/config/serializable.h
+2
-1
sflphone-common/src/config/yamlemitter.cpp
sflphone-common/src/config/yamlemitter.cpp
+25
-1
sflphone-common/src/config/yamlemitter.h
sflphone-common/src/config/yamlemitter.h
+1
-1
sflphone-common/src/iax/iaxaccount.cpp
sflphone-common/src/iax/iaxaccount.cpp
+1
-1
sflphone-common/src/iax/iaxaccount.h
sflphone-common/src/iax/iaxaccount.h
+1
-1
sflphone-common/src/preferences.cpp
sflphone-common/src/preferences.cpp
+4
-1
sflphone-common/src/preferences.h
sflphone-common/src/preferences.h
+1
-1
sflphone-common/src/sip/sipaccount.cpp
sflphone-common/src/sip/sipaccount.cpp
+2
-2
sflphone-common/src/sip/sipaccount.h
sflphone-common/src/sip/sipaccount.h
+2
-2
No files found.
sflphone-common/src/account.h
View file @
92c996dc
...
...
@@ -155,7 +155,7 @@ class Account : public Serializable{
*/
virtual
~
Account
();
virtual
void
serialize
(
Engine
*
engine
)
=
0
;
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
)
=
0
;
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
)
=
0
;
...
...
sflphone-common/src/config/serializable.h
View file @
92c996dc
...
...
@@ -33,6 +33,7 @@
#include "yamlparser.h"
#include "yamlemitter.h"
#include "yamlnode.h"
class
Engine
;
...
...
@@ -42,7 +43,7 @@ class Serializable {
public:
virtual
void
serialize
(
Engine
*
engine
)
=
0
;
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
)
=
0
;
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
)
=
0
;
...
...
sflphone-common/src/config/yamlemitter.cpp
View file @
92c996dc
...
...
@@ -120,8 +120,30 @@ void YamlEmitter::writeAccount(MappingNode *map)
}
void
YamlEmitter
::
writePreference
(
MappingNode
*
map
)
{
std
::
string
preferencestr
(
"preferences"
);
if
(
map
->
getType
()
==
MAPPING
)
throw
YamlEmitterException
(
"Node type is not a mapping while writing preferences"
);
int
preferenceid
=
yaml_document_add_scalar
(
&
document
,
NULL
,
(
yaml_char_t
*
)
preferencestr
.
c_str
(),
-
1
,
YAML_PLAIN_SCALAR_STYLE
);
int
preferencemapping
=
yaml_document_add_mapping
(
&
document
,
NULL
,
YAML_BLOCK_MAPPING_STYLE
);
yaml_document_append_mapping_pair
(
&
document
,
topLevelMapping
,
preferenceid
,
preferencemapping
);
Mapping
*
internalmap
=
map
->
getMapping
();
Mapping
::
iterator
iter
=
internalmap
->
begin
();
while
(
iter
!=
internalmap
->
end
())
{
addMappingItem
(
preferencemapping
,
iter
->
first
,
iter
->
second
);
iter
++
;
}
}
void
YamlEmitter
::
addMappingItem
(
int
mappingid
,
Key
key
,
YamlNode
*
node
)
void
YamlEmitter
::
addMappingItem
(
int
mappingid
,
Key
key
,
YamlNode
*
node
)
{
if
(
node
->
getType
()
==
SCALAR
)
{
...
...
@@ -148,6 +170,8 @@ void YamlEmitter::writeAccount(MappingNode *map)
iter
++
;
}
}
else
throw
YamlEmitterException
(
"Unknown node type while adding mapping node"
);
}
...
...
sflphone-common/src/config/yamlemitter.h
View file @
92c996dc
...
...
@@ -77,7 +77,7 @@ class YamlEmitter {
void
writeAccount
(
MappingNode
*
map
);
void
writePreference
();
void
writePreference
(
MappingNode
*
map
);
void
writeAddressbook
();
...
...
sflphone-common/src/iax/iaxaccount.cpp
View file @
92c996dc
...
...
@@ -47,7 +47,7 @@ IAXAccount::~IAXAccount()
_link
=
NULL
;
}
void
IAXAccount
::
serialize
(
Engine
*
engine
)
void
IAXAccount
::
serialize
(
Conf
::
YamlEmitter
*
emitter
)
{
}
...
...
sflphone-common/src/iax/iaxaccount.h
View file @
92c996dc
...
...
@@ -44,7 +44,7 @@ class IAXAccount : public Account
~
IAXAccount
();
virtual
void
serialize
(
Engine
*
engine
);
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
);
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
);
...
...
sflphone-common/src/preferences.cpp
View file @
92c996dc
...
...
@@ -50,7 +50,7 @@ Preferences::Preferences() : _accountOrder("")
Preferences
::~
Preferences
()
{}
void
Preferences
::
serialize
(
Engine
*
engine
)
void
Preferences
::
serialize
(
Conf
::
YamlEmitter
*
emiter
)
{
Conf
::
MappingNode
preferencemap
(
NULL
);
...
...
@@ -86,6 +86,7 @@ void Preferences::serialize(Engine *engine)
preferencemap
.
setKeyValue
(
zeroConfenableKey
,
&
zeroConfenable
);
preferencemap
.
setKeyValue
(
md5HashKey
,
&
md5Hash
);
}
void
Preferences
::
unserialize
(
Conf
::
MappingNode
*
map
)
...
...
@@ -118,4 +119,6 @@ void Preferences::unserialize(Conf::MappingNode *map)
val
=
(
Conf
::
ScalarNode
*
)(
map
->
getValue
(
md5HashKey
));
if
(
val
)
{
_md5Hash
=
(
val
->
getValue
().
compare
(
"true"
)
==
0
)
?
true
:
false
;
val
=
NULL
;
}
}
sflphone-common/src/preferences.h
View file @
92c996dc
...
...
@@ -54,7 +54,7 @@ class Preferences : public Serializable {
~
Preferences
();
virtual
void
serialize
(
Engine
*
engine
);
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
);
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
);
...
...
sflphone-common/src/sip/sipaccount.cpp
View file @
92c996dc
...
...
@@ -40,7 +40,7 @@ Credentials::Credentials() : credentialCount(0) {}
Credentials
::~
Credentials
()
{}
void
Credentials
::
serialize
(
Engine
*
engine
)
void
Credentials
::
serialize
(
Conf
::
YamlEmitter
*
emitter
)
{
}
...
...
@@ -132,7 +132,7 @@ SIPAccount::~SIPAccount()
free
(
_tlsSetting
);
}
void
SIPAccount
::
serialize
(
Engine
*
engine
)
{
void
SIPAccount
::
serialize
(
Conf
::
YamlEmitter
*
emitter
)
{
Conf
::
MappingNode
accountmap
(
NULL
);
...
...
sflphone-common/src/sip/sipaccount.h
View file @
92c996dc
...
...
@@ -134,7 +134,7 @@ class Credentials : public Serializable
~
Credentials
();
virtual
void
serialize
(
Engine
*
engine
);
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
);
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
);
...
...
@@ -170,7 +170,7 @@ class SIPAccount : public Account
*/
virtual
~
SIPAccount
();
virtual
void
serialize
(
Engine
*
engine
);
virtual
void
serialize
(
Conf
::
YamlEmitter
*
emitter
);
virtual
void
unserialize
(
Conf
::
MappingNode
*
map
);
...
...
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