Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
flatbuffers
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
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
flatbuffers
Commits
63f21cb2
Commit
63f21cb2
authored
Jul 22, 2014
by
Stewart Miles
Committed by
Android (Google) Code Review
Jul 20, 2014
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Terminate the output directory argument of flatc." into ub-games-master
parents
3f53f73c
60acef94
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
util.h
include/flatbuffers/util.h
+7
-0
flatc.cpp
src/flatc.cpp
+4
-1
idl_gen_java.cpp
src/idl_gen_java.cpp
+2
-5
No files found.
include/flatbuffers/util.h
View file @
63f21cb2
...
...
@@ -25,6 +25,13 @@
namespace
flatbuffers
{
static
const
char
kPosixPathSeparator
=
'/'
;
#ifdef _WIN32
static
const
char
kPathSeparator
=
'\\'
;
#else
static
const
char
kPathSeparator
=
kPosixPathSeparator
;
#endif // _WIN32
// Convert an integer or floating point value to a string.
// In contrast to std::stringstream, "char" values are
// converted to a string of digits.
...
...
src/flatc.cpp
View file @
63f21cb2
...
...
@@ -136,6 +136,10 @@ int main(int argc, const char *argv[]) {
case
'o'
:
if
(
++
i
>=
argc
)
Error
(
"missing path following"
,
arg
,
true
);
output_path
=
argv
[
i
];
if
(
!
(
output_path
.
back
()
==
flatbuffers
::
kPathSeparator
||
output_path
.
back
()
==
flatbuffers
::
kPosixPathSeparator
))
{
output_path
+=
flatbuffers
::
kPathSeparator
;
}
break
;
case
'S'
:
opts
.
strict_json
=
true
;
...
...
@@ -214,4 +218,3 @@ int main(int argc, const char *argv[]) {
return
0
;
}
src/idl_gen_java.cpp
View file @
63f21cb2
...
...
@@ -22,11 +22,9 @@
#ifdef _WIN32
#include <direct.h>
#define PATH_SEPARATOR "\\"
#define mkdir(n, m) _mkdir(n)
#else
#include <sys/stat.h>
#define PATH_SEPARATOR "/"
#endif
namespace
flatbuffers
{
...
...
@@ -345,7 +343,7 @@ static bool SaveClass(const Parser &parser, const Definition &def,
it
!=
parser
.
name_space_
.
end
();
++
it
)
{
if
(
name_space_java
.
length
())
{
name_space_java
+=
"."
;
name_space_dir
+=
PATH_SEPARATOR
;
name_space_dir
+=
kPathSeparator
;
}
name_space_java
+=
*
it
;
name_space_dir
+=
*
it
;
...
...
@@ -359,7 +357,7 @@ static bool SaveClass(const Parser &parser, const Definition &def,
code
+=
"import flatbuffers.*;
\n\n
"
;
}
code
+=
classcode
;
auto
filename
=
name_space_dir
+
PATH_SEPARATOR
+
def
.
name
+
".java"
;
auto
filename
=
name_space_dir
+
kPathSeparator
+
def
.
name
+
".java"
;
return
SaveFile
(
filename
.
c_str
(),
code
,
false
);
}
...
...
@@ -391,4 +389,3 @@ bool GenerateJava(const Parser &parser,
}
}
// namespace flatbuffers
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