From 49d0e291d83f66d7e1ed393e03eb1b50a2abc560 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Sun, 11 Sep 2011 10:01:38 -0400 Subject: add templates for use with hg-tools/create.py --- scripts/templates/template-cpp.cpp | 29 +++++++++++++++++++++++++++++ scripts/templates/template-h.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 scripts/templates/template-cpp.cpp create mode 100644 scripts/templates/template-h.h (limited to 'scripts') diff --git a/scripts/templates/template-cpp.cpp b/scripts/templates/template-cpp.cpp new file mode 100644 index 0000000000..7a8797698a --- /dev/null +++ b/scripts/templates/template-cpp.cpp @@ -0,0 +1,29 @@ +/** +* @file #filename#.cpp +* @brief Implementation of #filename# +* @author #getpass.getuser()#@lindenlab.com +* +* $LicenseInfo:firstyear=#datetime.datetime.now().year#&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) #datetime.datetime.now().year#, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ + + +#'%c'%35#include "#filename#.h" diff --git a/scripts/templates/template-h.h b/scripts/templates/template-h.h new file mode 100644 index 0000000000..de40a8e071 --- /dev/null +++ b/scripts/templates/template-h.h @@ -0,0 +1,31 @@ +/** +* @file #filename#.h +* @brief Header file for #filename# +* @author #getpass.getuser()#@lindenlab.com +* +* $LicenseInfo:firstyear=#datetime.datetime.now().year#&license=viewerlgpl$ +* Second Life Viewer Source Code +* Copyright (C) #datetime.datetime.now().year#, Linden Research, Inc. +* +* This library is free software; you can redistribute it and/or +* modify it under the terms of the GNU Lesser General Public +* License as published by the Free Software Foundation; +* version 2.1 of the License only. +* +* This library is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* Lesser General Public License for more details. +* +* You should have received a copy of the GNU Lesser General Public +* License along with this library; if not, write to the Free Software +* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +* +* Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA +* $/LicenseInfo$ +*/ +#'%c'%35#ifndef LL_#filename.upper().replace('-','_')#_H +#'%c'%35#define LL_#filename.upper().replace('-','_')#_H + + +#'%c'%35#endif LL_#filename.upper().replace('-','_')#_H -- cgit v1.2.3 From 9df77524fce4dd0df7f63e2909e0b5f6170d24db Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 12 Sep 2011 07:21:22 -0400 Subject: only include the h file when it is being created, and make the #endif in the h file safer for picky compilers --- scripts/templates/template-cpp.cpp | 3 ++- scripts/templates/template-h.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/templates/template-cpp.cpp b/scripts/templates/template-cpp.cpp index 7a8797698a..35d8441c87 100644 --- a/scripts/templates/template-cpp.cpp +++ b/scripts/templates/template-cpp.cpp @@ -26,4 +26,5 @@ */ -#'%c'%35#include "#filename#.h" +#'' if ( skip_h ) else '%cinclude "%s.h"' % (35,filename)# + diff --git a/scripts/templates/template-h.h b/scripts/templates/template-h.h index de40a8e071..ce7b4ddc87 100644 --- a/scripts/templates/template-h.h +++ b/scripts/templates/template-h.h @@ -28,4 +28,4 @@ #'%c'%35#define LL_#filename.upper().replace('-','_')#_H -#'%c'%35#endif LL_#filename.upper().replace('-','_')#_H +#'%c'%35#endif // LL_#filename.upper().replace('-','_')#_H -- cgit v1.2.3