Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
sq975
openpose
提交
7f8890e0
O
openpose
项目概览
sq975
/
openpose
与 Fork 源项目一致
从无法访问的项目Fork
通知
7
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
O
openpose
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
7f8890e0
编写于
3月 12, 2019
作者:
G
Gines Hidalgo
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Fixed Ubuntu 14 crash
上级
063c0354
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
18 deletion
+20
-18
include/openpose/filestream/jsonOfstream.hpp
include/openpose/filestream/jsonOfstream.hpp
+3
-3
src/openpose/filestream/jsonOfstream.cpp
src/openpose/filestream/jsonOfstream.cpp
+17
-15
未找到文件。
include/openpose/filestream/jsonOfstream.hpp
浏览文件 @
7f8890e0
...
...
@@ -43,12 +43,12 @@ namespace op
template
<
typename
T
>
inline
void
plainText
(
const
T
&
value
)
{
m
Ofstream
<<
value
;
*
up
Ofstream
<<
value
;
}
inline
void
comma
()
{
m
Ofstream
<<
","
;
*
up
Ofstream
<<
","
;
}
void
enter
();
...
...
@@ -57,7 +57,7 @@ namespace op
bool
mHumanReadable
;
long
long
mBracesCounter
;
long
long
mBracketsCounter
;
std
::
ofstream
mOfstream
;
std
::
unique_ptr
<
std
::
ofstream
>
upOfstream
;
// std::unique_ptr to solve std::move issue in GCC < 5
DELETE_COPY
(
JsonOfstream
);
};
...
...
src/openpose/filestream/jsonOfstream.cpp
浏览文件 @
7f8890e0
...
...
@@ -24,11 +24,11 @@ namespace op
mHumanReadable
{
humanReadable
},
mBracesCounter
{
0
},
mBracketsCounter
{
0
},
mOfstream
{
filePath
}
upOfstream
{
new
std
::
ofstream
{
filePath
}
}
{
try
{
if
(
!
filePath
.
empty
()
&&
!
mOfstream
.
is_open
())
if
(
!
filePath
.
empty
()
&&
!
upOfstream
->
is_open
())
error
(
"Json file could not be opened."
,
__LINE__
,
__FUNCTION__
,
__FILE__
);
}
catch
(
const
std
::
exception
&
e
)
...
...
@@ -44,7 +44,8 @@ namespace op
{
try
{
std
::
swap
(
mOfstream
,
jsonOfstream
.
mOfstream
);
upOfstream
=
std
::
move
(
jsonOfstream
.
upOfstream
);
// std::swap(upOfstream, jsonOfstream.upOfstream);
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -59,7 +60,8 @@ namespace op
mHumanReadable
=
jsonOfstream
.
mHumanReadable
;
mBracesCounter
=
jsonOfstream
.
mBracesCounter
;
mBracketsCounter
=
jsonOfstream
.
mBracketsCounter
;
std
::
swap
(
mOfstream
,
jsonOfstream
.
mOfstream
);
upOfstream
=
std
::
move
(
jsonOfstream
.
upOfstream
);
// std::swap(upOfstream, jsonOfstream.upOfstream);
// Return
return
*
this
;
}
...
...
@@ -74,7 +76,7 @@ namespace op
{
try
{
enterAndTab
(
m
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
enterAndTab
(
*
up
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
if
(
mBracesCounter
!=
0
||
mBracketsCounter
!=
0
)
{
...
...
@@ -99,7 +101,7 @@ namespace op
try
{
mBracesCounter
++
;
m
Ofstream
<<
"{"
;
*
up
Ofstream
<<
"{"
;
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -112,8 +114,8 @@ namespace op
try
{
mBracesCounter
--
;
enterAndTab
(
m
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
m
Ofstream
<<
"}"
;
enterAndTab
(
*
up
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
*
up
Ofstream
<<
"}"
;
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -126,8 +128,8 @@ namespace op
try
{
mBracketsCounter
++
;
m
Ofstream
<<
"["
;
enterAndTab
(
m
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
*
up
Ofstream
<<
"["
;
enterAndTab
(
*
up
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -140,8 +142,8 @@ namespace op
try
{
mBracketsCounter
--
;
enterAndTab
(
m
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
m
Ofstream
<<
"]"
;
enterAndTab
(
*
up
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
*
up
Ofstream
<<
"]"
;
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -166,8 +168,8 @@ namespace op
{
try
{
enterAndTab
(
m
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
m
Ofstream
<<
"
\"
"
+
string
+
"
\"
:"
;
enterAndTab
(
*
up
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
*
up
Ofstream
<<
"
\"
"
+
string
+
"
\"
:"
;
}
catch
(
const
std
::
exception
&
e
)
{
...
...
@@ -179,7 +181,7 @@ namespace op
{
try
{
enterAndTab
(
m
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
enterAndTab
(
*
up
Ofstream
,
mHumanReadable
,
mBracesCounter
,
mBracketsCounter
);
}
catch
(
const
std
::
exception
&
e
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录