Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
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
Show more breadcrumbs
pub
frama-c
Commits
f55587a3
Commit
f55587a3
authored
11 months ago
by
Loïc Correnson
Browse files
Options
Downloads
Patches
Plain Diff
[server] added Jfile converters
parent
993f9409
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/plugins/server/data.ml
+8
-0
8 additions, 0 deletions
src/plugins/server/data.ml
src/plugins/server/data.mli
+1
-0
1 addition, 0 deletions
src/plugins/server/data.mli
src/plugins/server/kernel_main.ml
+4
-4
4 additions, 4 deletions
src/plugins/server/kernel_main.ml
with
13 additions
and
4 deletions
src/plugins/server/data.ml
+
8
−
0
View file @
f55587a3
...
@@ -210,6 +210,14 @@ struct
...
@@ -210,6 +210,14 @@ struct
let
to_json
s
=
`String
s
let
to_json
s
=
`String
s
end
end
module
Jfile
:
S
with
type
t
=
Filepath
.
Normalized
.
t
=
struct
type
t
=
Filepath
.
Normalized
.
t
let
jtype
=
Jstring
let
of_json
js
=
Ju
.
to_string
js
|>
Filepath
.
Normalized
.
of_string
let
to_json
(
file
:
t
)
=
`String
(
file
:>
string
)
end
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
(* --- Text Datatypes --- *)
(* --- Text Datatypes --- *)
(* -------------------------------------------------------------------------- *)
(* -------------------------------------------------------------------------- *)
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/data.mli
+
1
−
0
View file @
f55587a3
...
@@ -81,6 +81,7 @@ module Jint : S with type t = int
...
@@ -81,6 +81,7 @@ module Jint : S with type t = int
module
Jfloat
:
S
with
type
t
=
float
module
Jfloat
:
S
with
type
t
=
float
module
Jstring
:
S
with
type
t
=
string
module
Jstring
:
S
with
type
t
=
string
module
Jalpha
:
S
with
type
t
=
string
module
Jalpha
:
S
with
type
t
=
string
module
Jfile
:
S
with
type
t
=
Filepath
.
Normalized
.
t
(** Rich text encoding, see [Jbuffer]. *)
(** Rich text encoding, see [Jbuffer]. *)
module
Jtext
:
S
with
type
t
=
json
module
Jtext
:
S
with
type
t
=
json
...
...
This diff is collapsed.
Click to expand it.
src/plugins/server/kernel_main.ml
+
4
−
4
View file @
f55587a3
...
@@ -65,20 +65,20 @@ let () =
...
@@ -65,20 +65,20 @@ let () =
let
()
=
let
()
=
Request
.
register
~
package
~
kind
:
`SET
~
name
:
"load"
Request
.
register
~
package
~
kind
:
`SET
~
name
:
"load"
~
descr
:
(
Md
.
plain
"Load a save file. Returns an error, if not successfull."
)
~
descr
:
(
Md
.
plain
"Load a save file. Returns an error, if not successfull."
)
~
input
:
(
module
J
string
)
~
input
:
(
module
J
file
)
~
output
:
(
module
Joption
(
Jstring
))
~
output
:
(
module
Joption
(
Jstring
))
(
fun
file
->
(
fun
file
->
try
Project
.
load_all
(
Filepath
.
Normalized
.
of_string
file
)
;
None
try
Project
.
load_all
file
;
None
with
Project
.
IOError
err
->
Some
err
)
with
Project
.
IOError
err
->
Some
err
)
let
()
=
let
()
=
Request
.
register
~
package
~
kind
:
`SET
~
name
:
"save"
Request
.
register
~
package
~
kind
:
`SET
~
name
:
"save"
~
descr
:
(
Md
.
plain
"Save the current session. Returns an error, if not successfull."
)
~
descr
:
(
Md
.
plain
"Save the current session. Returns an error, if not successfull."
)
~
input
:
(
module
J
string
)
~
input
:
(
module
J
file
)
~
output
:
(
module
Joption
(
Jstring
))
~
output
:
(
module
Joption
(
Jstring
))
(
fun
file
->
(
fun
file
->
try
Project
.
save_all
(
Filepath
.
Normalized
.
of_string
file
)
;
None
try
Project
.
save_all
file
;
None
with
Project
.
IOError
err
->
Some
err
)
with
Project
.
IOError
err
->
Some
err
)
...
...
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