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
35cb1ed0
Commit
35cb1ed0
authored
Sep 28, 2011
by
Rob Jonson
Committed by
Jean-Baptiste Kempf
Oct 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
generate properly escaped json
Signed-off-by:
Jean-Baptiste Kempf
<
jb@videolan.org
>
parent
514b0244
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
48 deletions
+8
-48
share/lua/http/requests/browse.json
share/lua/http/requests/browse.json
+2
-3
share/lua/http/requests/playlist.json
share/lua/http/requests/playlist.json
+1
-3
share/lua/http/requests/status.json
share/lua/http/requests/status.json
+1
-3
share/lua/intf/modules/httprequests.lua
share/lua/intf/modules/httprequests.lua
+4
-39
No files found.
share/lua/http/requests/browse.json
View file @
35cb1ed0
...
...
@@ -33,8 +33,7 @@ httprequests.processcommands()
local
browseTable=httprequests.getbrowsetable()
print('
{
')
httprequests.printTableAsJson(browseTable
,
0
)
print('
}
')
httprequests.printTableAsJson(browseTable)
?>
share/lua/http/requests/playlist.json
View file @
35cb1ed0
...
...
@@ -31,8 +31,6 @@ require "httprequests"
httprequests.processcommands()
print('
{
')
httprequests.printTableAsJson(httprequests.playlisttable()
,
0
)
print('
}
')
httprequests.printTableAsJson(httprequests.playlisttable())
?>
share/lua/http/requests/status.json
View file @
35cb1ed0
...
...
@@ -33,8 +33,6 @@ httprequests.processcommands()
local
statusTable=httprequests.getstatus(
true
)
print('
{
')
httprequests.printTableAsJson(statusTable
,
0
)
print('
}
')
httprequests.printTableAsJson(statusTable)
?>
share/lua/intf/modules/httprequests.lua
View file @
35cb1ed0
...
...
@@ -24,6 +24,7 @@
module
(
"httprequests"
,
package
.
seeall
)
local
dkjson
=
require
(
"dkjson"
)
...
...
@@ -195,47 +196,11 @@ function xmlString(s)
end
end
local
printJsonKeyValue
=
function
(
k
,
v
,
indent
)
print
(
"
\n
"
)
for
i
=
1
,
indent
do
print
(
" "
)
end
if
(
k
)
then
print
(
"
\"
"
..
k
..
"
\"
:"
)
end
if
(
type
(
v
)
==
"number"
)
then
print
(
xmlString
(
v
))
elseif
(
type
(
v
)
==
"table"
)
then
if
(
v
.
_array
==
NULL
)
then
print
(
"{\n"
)
printTableAsJson
(
v
,
indent
+
2
)
print
(
"
\n
}"
)
else
print
(
"["
)
printArrayAsJson
(
v
.
_array
,
indent
+
2
)
print
(
"
\n
]"
)
end
else
print
(
"
\"
"
..
xmlString
(
v
)
..
"
\"
"
)
end
end
printArrayAsJson
=
function
(
array
,
indent
)
first
=
true
for
i
,
v
in
ipairs
(
array
)
do
if
not
first
then
print
(
","
)
end
printJsonKeyValue
(
NULL
,
v
,
indent
)
first
=
false
end
end
printTableAsJson
=
function
(
dict
,
indent
)
first
=
true
for
k
,
v
in
pairs
(
dict
)
do
if
not
first
then
print
(
","
)
end
printJsonKeyValue
(
k
,
v
,
indent
)
first
=
false
end
printTableAsJson
=
function
(
dict
)
local
output
=
dkjson
.
encode
(
dict
,
{
indent
=
true
})
print
(
output
)
end
local
printXmlKeyValue
=
function
(
k
,
v
,
indent
)
...
...
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