return str.substr(first, (last - first + 1));
}
-void CGeneratorBase::GenLicenseDescription(std::ofstream& stream) {
- GenTemplate(CB_COPYRIGHT, stream,
+void CGeneratorBase::GenVersion(std::ofstream& stream) {
+ GenTemplate(CB_VERSION, stream,
[&]()->std::string {
return FULLVER;
- },
- [&]()->std::string {
- std::time_t t = std::time(NULL);
- std::tm* local_time = std::localtime(&t);
- return std::to_string(local_time->tm_year + 1900);
});
}
return structures_;
}
- void GenLicenseDescription(std::ofstream& stream);
+ void GenVersion(std::ofstream& stream);
void GenIncludeDefaultHeaders(std::ofstream& stream, bool body = true);
void GenGNUSourceDefinition(std::ofstream& stream);
std::string GetStructIdWithNamespace(const Structure& st);
#ifndef IDLC_C_GEN_C_GEN_BASE_CB_H_
#define IDLC_C_GEN_C_GEN_BASE_CB_H_
-const char CB_COPYRIGHT[] =
+const char CB_VERSION[] =
R"__c_cb(/*
* Generated by tidlc $$.
- *
- * Copyright (c) $$ Samsung Electronics Co., Ltd.
- *
- * 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.
*/
)__c_cb";
: CBodyGeneratorBase(doc) {}
void CProxyBodyGen::OnInitGen(std::ofstream& stream) {
- GenLicenseDescription(stream);
+ GenVersion(stream);
GenGNUSourceDefinition(stream);
GenIncludeDefaultHeaders(stream);
GenIncludeHeader(stream);
: CHeaderGeneratorBase(doc) {}
void CProxyHeaderGen::OnInitGen(std::ofstream& stream) {
- GenLicenseDescription(stream);
+ GenVersion(stream);
GenPragmaOnce(stream);
GenIncludeDefaultHeaders(stream, false);
GenExplicitLinkageOpen(stream);
: CBodyGeneratorBase(doc) {}
void CStubBodyGen::OnInitGen(std::ofstream& stream) {
- GenLicenseDescription(stream);
+ GenVersion(stream);
GenGNUSourceDefinition(stream);
GenIncludeDefaultHeaders(stream);
GenIncludeHeader(stream);
: CHeaderGeneratorBase(doc) {}
void CStubHeaderGen::OnInitGen(std::ofstream& stream) {
- GenLicenseDescription(stream);
+ GenVersion(stream);
GenPragmaOnce(stream);
GenIncludeDefaultHeaders(stream, false);
GenExplicitLinkageOpen(stream);
});
}
-void CppGeneratorBase::GenCopyright(std::ofstream& stream) {
- GenTemplate(CB_COPYRIGHT, stream,
+void CppGeneratorBase::GenVersion(std::ofstream& stream) {
+ GenTemplate(CB_VERSION, stream,
[&]()->std::string {
return FULLVER;
- },
- [&]()->std::string {
- std::time_t t = std::time(NULL);
- std::tm* local_time = std::localtime(&t);
- return std::to_string(local_time->tm_year + 1900);
});
}
explicit CppGeneratorBase(std::shared_ptr<Document> doc);
virtual ~CppGeneratorBase() = default;
- void GenCopyright(std::ofstream& stream);
+ void GenVersion(std::ofstream& stream);
void GenStructuresForHeader(std::ofstream& stream);
void GenStructuresForBody(std::ofstream& stream);
void GenSerializer(std::ofstream& stream);
}
)__cpp_cb";
-const char CB_COPYRIGHT[] =
+const char CB_VERSION[] =
R"__cpp_cb(/*
* Generated by tidlc $$.
- *
- * Copyright (c) $$ Samsung Electronics Co., Ltd.
- *
- * 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.
*/
)__cpp_cb";
if (found != std::string::npos)
header_file.replace(found, key.length(), ".h");
- GenCopyright(stream);
+ GenVersion(stream);
stream << NLine(1);
stream << "#include <stdlib.h>" << NLine(1)
<< "#include <assert.h>" << NLine(1)
: CppGeneratorBase(doc) {}
void CppProxyHeaderGen::OnInitGen(std::ofstream& stream) {
- GenCopyright(stream);
+ GenVersion(stream);
stream << CB_HEADER;
GenNamespace(stream);
}
if (found != std::string::npos)
header_file.replace(found, key.length(), ".h");
- GenCopyright(stream);
+ GenVersion(stream);
stream << NLine(1);
stream << "#include <stdlib.h>" << NLine(1)
<< "#include <assert.h>" << NLine(1)
: CppGeneratorBase(doc) {}
void CppStubHeaderGen::OnInitGen(std::ofstream& stream) {
- GenCopyright(stream);
+ GenVersion(stream);
stream << CB_HEADER;
GenNamespace(stream);
}
+++ /dev/null
-/*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-
-#ifndef IDLC_CS_GEN_CS_CB_COPYRIGHT_H_
-#define IDLC_CS_GEN_CS_CB_COPYRIGHT_H_
-
-const char cs_cb_copyright[] =
-R"__cs_cb(/*
- * Generated by tidlc $$.
- *
- * Copyright (c) $$ Samsung Electronics Co., Ltd.
- *
- * 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.
- */
-)__cs_cb";
-
-#endif // IDLC_CS_GEN_CS_CB_COPYRIGHT_H_
--- /dev/null
+/*
+ * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ *
+ * 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.
+ */
+
+#ifndef IDLC_CS_GEN_CS_CB_VERSION_H_
+#define IDLC_CS_GEN_CS_CB_VERSION_H_
+
+const char cs_cb_version[] =
+R"__cs_cb(/*
+ * Generated by tidlc $$.
+ */
+)__cs_cb";
+
+#endif // IDLC_CS_GEN_CS_CB_VERSION_H_
#include "idlc/cs_gen/cs_gen_base.h"
namespace {
-#include "idlc/cs_gen/cs_cb_copyright.h"
+#include "idlc/cs_gen/cs_cb_version.h"
#include "idlc/cs_gen/cs_gen_base_cb.h"
#include "idlc/cs_gen/cs_cb_rpc_port.h"
}
});
}
-void CsGeneratorBase::GenCopyright(std::ofstream& stream) {
- GenTemplate(::cs_cb_copyright, stream,
+void CsGeneratorBase::GenVersion(std::ofstream& stream) {
+ GenTemplate(::cs_cb_version, stream,
[&]()->std::string {
return FULLVER;
- },
- [&]()->std::string {
- std::time_t t = std::time(NULL);
- std::tm* local_time = std::localtime(&t);
- return std::to_string(local_time->tm_year + 1900);
});
stream << NLine(1);
}
explicit CsGeneratorBase(std::shared_ptr<Document> doc);
virtual ~CsGeneratorBase() = default;
- void GenCopyright(std::ofstream& stream);
+ void GenVersion(std::ofstream& stream);
void GenStructures(std::ofstream& stream);
void GenStructure(std::ofstream& stream, const Structure& st);
void GenSerializer(std::ofstream& stream);
: CsGeneratorBase(doc) {}
void CsLibGen::OnInitGen(std::ofstream& stream) {
- GenCopyright(stream);
+ GenVersion(stream);
stream << "using System;" << NLine(1)
<< "using System.Collections.Generic;" << NLine(1)
<< "using System.Runtime.InteropServices;" << NLine(1)
: CsGeneratorBase(doc) {}
void CsProxyGen::OnInitGen(std::ofstream& stream) {
- GenCopyright(stream);
+ GenVersion(stream);
stream << "using System;" << NLine(1)
<< "using System.Collections.Generic;" << NLine(1)
<< "using System.Threading;" << NLine(1)
: CsGeneratorBase(doc) {}
void CsStubGen::OnInitGen(std::ofstream& stream) {
- GenCopyright(stream);
+ GenVersion(stream);
stream << "using System;" << NLine(1)
<< "using System.Collections.Generic;" << NLine(1)
<< "using Tizen.Applications;" << NLine(1)