From 432f3f26a40dbc51691c6d461d8a137c5e6c9f2e Mon Sep 17 00:00:00 2001 From: loverszhaokai Date: Sat, 28 Feb 2015 18:06:53 +0800 Subject: [PATCH] Added Copyright headers Change-Id: I106de8985cea572590d49c896b72c54f33e73bd2 --- net/FlatBuffers/FlatBufferConstants.cs | 18 +++++++++++- net/FlatBuffers/Properties/AssemblyInfo.cs | 20 +++++++++++-- src/idl_gen_general.cpp | 4 +-- tests/FlatBuffers.Test/Assert.cs | 18 +++++++++++- tests/FlatBuffers.Test/Program.cs | 18 +++++++++++- .../Properties/AssemblyInfo.cs | 28 +++++++++++++++---- tests/JavaTest.sh | 6 ++-- tests/go_test.go | 16 +++++++++++ 8 files changed, 112 insertions(+), 16 deletions(-) diff --git a/net/FlatBuffers/FlatBufferConstants.cs b/net/FlatBuffers/FlatBufferConstants.cs index 5c3706e10..162ed1923 100644 --- a/net/FlatBuffers/FlatBufferConstants.cs +++ b/net/FlatBuffers/FlatBufferConstants.cs @@ -1,4 +1,20 @@ -using System; +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/net/FlatBuffers/Properties/AssemblyInfo.cs b/net/FlatBuffers/Properties/AssemblyInfo.cs index 3d4ea15cc..1065ff8f2 100644 --- a/net/FlatBuffers/Properties/AssemblyInfo.cs +++ b/net/FlatBuffers/Properties/AssemblyInfo.cs @@ -1,4 +1,20 @@ -using System.Reflection; +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +26,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("FlatBuffers")] -[assembly: AssemblyCopyright("Copyright © 2014 Google Inc")] +[assembly: AssemblyCopyright("Copyright © 2015 Google Inc")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/src/idl_gen_general.cpp b/src/idl_gen_general.cpp index 562fd5f52..0336ad8ae 100644 --- a/src/idl_gen_general.cpp +++ b/src/idl_gen_general.cpp @@ -324,11 +324,11 @@ static void GenStruct(const LanguageParameters &lang, const Parser &parser, // of a FlatBuffer std::string method_name = FunctionStart(lang, 'G') + "etRootAs" + struct_def.name; std::string method_signature = " public static " + struct_def.name + " " + method_name; - + // create convenience method that doesn't require an existing object code += method_signature + "(ByteBuffer _bb) "; code += "{ return " + method_name + "(_bb, new " + struct_def.name+ "()); }\n"; - + // create method that allows object reuse code += method_signature + "(ByteBuffer _bb, " + struct_def.name + " obj) { "; code += lang.set_bb_byteorder; diff --git a/tests/FlatBuffers.Test/Assert.cs b/tests/FlatBuffers.Test/Assert.cs index 7f2a1228e..932f05747 100644 --- a/tests/FlatBuffers.Test/Assert.cs +++ b/tests/FlatBuffers.Test/Assert.cs @@ -1,4 +1,20 @@ -using System; +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; using System.Collections.Generic; using System.Linq; using System.Text; diff --git a/tests/FlatBuffers.Test/Program.cs b/tests/FlatBuffers.Test/Program.cs index 2662b2a3d..6006004a7 100644 --- a/tests/FlatBuffers.Test/Program.cs +++ b/tests/FlatBuffers.Test/Program.cs @@ -1,4 +1,20 @@ -using System; +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System; using System.Linq; using System.Reflection; diff --git a/tests/FlatBuffers.Test/Properties/AssemblyInfo.cs b/tests/FlatBuffers.Test/Properties/AssemblyInfo.cs index ee3b831c7..73be32683 100644 --- a/tests/FlatBuffers.Test/Properties/AssemblyInfo.cs +++ b/tests/FlatBuffers.Test/Properties/AssemblyInfo.cs @@ -1,8 +1,24 @@ -using System.Reflection; +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; -// General Information about an assembly is controlled through the following +// General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. [assembly: AssemblyTitle("FlatBuffers.Test")] @@ -14,8 +30,8 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] @@ -25,11 +41,11 @@ using System.Runtime.InteropServices; // Version information for an assembly consists of the following four values: // // Major Version -// Minor Version +// Minor Version // Build Number // Revision // -// You can specify all the values or you can default the Build and Revision Numbers +// You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] diff --git a/tests/JavaTest.sh b/tests/JavaTest.sh index 4bcdaf97d..1a93aec62 100755 --- a/tests/JavaTest.sh +++ b/tests/JavaTest.sh @@ -1,13 +1,13 @@ #!/bin/sh # Copyright 2014 Google Inc. All rights reserved. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. diff --git a/tests/go_test.go b/tests/go_test.go index 351b31ebd..a9496355d 100644 --- a/tests/go_test.go +++ b/tests/go_test.go @@ -1,3 +1,19 @@ +/* + * Copyright 2014 Google Inc. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package main import (