[17] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | # Create a skeleton of a wrapper header for a certain class
|
---|
| 4 |
|
---|
| 5 | classname=$1
|
---|
| 6 | uppername=`echo ${classname} | tr a-z A-Z`
|
---|
| 7 |
|
---|
| 8 | cat > "${classname}.h" <<EOF
|
---|
| 9 | // Copyright (c) 2012 by István Váradi
|
---|
| 10 |
|
---|
| 11 | // This file is part of libxplcommon, a common utility library for
|
---|
| 12 | // development related to X-Plane
|
---|
| 13 |
|
---|
| 14 | // Redistribution and use in source and binary forms, with or without
|
---|
| 15 | // modification, are permitted provided that the following conditions are met:
|
---|
| 16 |
|
---|
| 17 | // 1. Redistributions of source code must retain the above copyright notice, this
|
---|
| 18 | // list of conditions and the following disclaimer.
|
---|
| 19 | // 2. Redistributions in binary form must reproduce the above copyright notice,
|
---|
| 20 | // this list of conditions and the following disclaimer in the documentation
|
---|
| 21 | // and/or other materials provided with the distribution.
|
---|
| 22 |
|
---|
| 23 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
---|
| 24 | // ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
---|
| 25 | // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
---|
| 26 | // DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
|
---|
| 27 | // ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
---|
| 28 | // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
---|
| 29 | // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
---|
| 30 | // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
---|
| 31 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
---|
| 32 | // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
---|
| 33 |
|
---|
| 34 | // The views and conclusions contained in the software and documentation are those
|
---|
| 35 | // of the authors and should not be interpreted as representing official policies,
|
---|
| 36 | // either expressed or implied, of the FreeBSD Project.
|
---|
| 37 |
|
---|
| 38 | #ifndef XPLCOMMON_${uppername}_H
|
---|
| 39 | #define XPLCOMMON_${uppername}_H
|
---|
| 40 | //------------------------------------------------------------------------------
|
---|
| 41 |
|
---|
| 42 | #if 0 // The public interface of ${classname}
|
---|
| 43 |
|
---|
| 44 | //------------------------------------------------------------------------------
|
---|
| 45 |
|
---|
| 46 | namespace xplcommon {
|
---|
| 47 |
|
---|
| 48 | //------------------------------------------------------------------------------
|
---|
| 49 |
|
---|
| 50 | class ${classname}
|
---|
| 51 | {
|
---|
| 52 | public:
|
---|
| 53 | };
|
---|
| 54 |
|
---|
| 55 | //------------------------------------------------------------------------------
|
---|
| 56 |
|
---|
| 57 | } /* namespace xplcommon */
|
---|
| 58 |
|
---|
| 59 | //------------------------------------------------------------------------------
|
---|
| 60 |
|
---|
| 61 | #endif // 0, The public interface of ${classname}
|
---|
| 62 |
|
---|
| 63 | //------------------------------------------------------------------------------
|
---|
| 64 |
|
---|
| 65 | #include "config.h"
|
---|
| 66 |
|
---|
| 67 | //------------------------------------------------------------------------------
|
---|
| 68 |
|
---|
| 69 | #if TARGET_API_WIN32
|
---|
| 70 |
|
---|
| 71 | //------------------------------------------------------------------------------
|
---|
| 72 |
|
---|
| 73 | #include "win32/${classname}.h"
|
---|
| 74 |
|
---|
| 75 | namespace xplcommon { typedef win32::${classname} ${classname}; }
|
---|
| 76 |
|
---|
| 77 | //------------------------------------------------------------------------------
|
---|
| 78 |
|
---|
| 79 | #else // TARGET_API_WIN32
|
---|
| 80 |
|
---|
| 81 | //------------------------------------------------------------------------------
|
---|
| 82 |
|
---|
| 83 | #include "posix/${classname}.h"
|
---|
| 84 |
|
---|
| 85 | namespace xplcommon { typedef posix::${classname} ${classname}; }
|
---|
| 86 |
|
---|
| 87 | //------------------------------------------------------------------------------
|
---|
| 88 |
|
---|
| 89 | #endif // TARGET_API_WIN32
|
---|
| 90 |
|
---|
| 91 | //------------------------------------------------------------------------------
|
---|
| 92 | #endif // XPLCOMMON_${uppername}_H
|
---|
| 93 |
|
---|
| 94 | // Local Variables:
|
---|
| 95 | // mode: C++
|
---|
| 96 | // c-basic-offset: 4
|
---|
| 97 | // indent-tabs-mode: nil
|
---|
| 98 | // End:
|
---|
| 99 | EOF
|
---|
| 100 |
|
---|
| 101 | hg add "${classname}.h"
|
---|