| 1 | /* oo_CAN_WRITE_AS_ENCODING.h |
| 2 | * |
| 3 | * Copyright (C) 2007,2009,2011-2020,2022,2024,2026 Paul Boersma |
| 4 | * |
| 5 | * This code is free software; you can redistribute it and/or modify |
| 6 | * it under the terms of the GNU General Public License as published by |
| 7 | * the Free Software Foundation; either version 3 of the License, or (at |
| 8 | * your option) any later version. |
| 9 | * |
| 10 | * This code is distributed in the hope that it will be useful, but |
| 11 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 13 | * See the GNU General Public License for more details. |
| 14 | * |
| 15 | * You should have received a copy of the GNU General Public License |
| 16 | * along with this work. If not, see <http://www.gnu.org/licenses/>. |
| 17 | */ |
| 18 | |
| 19 | #include "oo_undef.h"cxx . . $ `<file>/sys/oo_undef.h`/ |
| 20 | |
| 21 | #define oo_SIMPLEcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:21:9`!(type, storage, x) |
| 22 | |
| 23 | #define oo_SETcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:23:9`!(type, storage, x, setType) |
| 24 | |
| 25 | #define oo_ANYVECcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:25:9`!(type, storage, x, sizeExpression) |
| 26 | |
| 27 | #define oo_ANYMATcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:27:9`!(type, storage, x, nrowExpression, ncolExpression) |
| 28 | |
| 29 | #define oo_ANYTEN3cxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:29:9`!(type, storage, x, ndim1Expression, ndim2Expression, ndim3Expression) |
| 30 | |
| 31 | #define oo_ENUMxcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:31:9`!(kType, storage, x) |
| 32 | |
| 33 | //#define oo_ENUMx_SET(kType, storage, x, setType) |
| 34 | |
| 35 | #define oo_STRINGxcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:35:9`!(storage, x) \ |
| 36 | if (ourcxx . . $ `melder/melder.h:42:9`! x && ! Melder_isEncodable (ourcxx . . $ `melder/melder.h:42:9`! x.get(), encoding)) \ |
| 37 | return false; |
| 38 | |
| 39 | #define oo_STRINGx_SETcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:39:9`!(storage, x, setType) \ |
| 40 | for (int _i = 0; _i <= setType::MAX; _i ++) \ |
| 41 | if (our x [_i] && ! Melder_isEncodable (our x [_i].get(), encoding)) \ |
| 42 | return false; |
| 43 | |
| 44 | #define oo_STRINGx_VECTORcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:44:9`!(storage, x, sizeExpression) \ |
| 45 | { \ |
| 46 | const integer _size = (sizeExpression); \ |
| 47 | Melder_assert (_size == our x.size); \ |
| 48 | if (our x) { \ |
| 49 | for (integer _i = 1; _i <= _size; _i ++) { \ |
| 50 | if (our x [_i] && ! Melder_isEncodable (our x [_i].get(), encoding)) \ |
| 51 | return false; \ |
| 52 | } \ |
| 53 | } \ |
| 54 | } |
| 55 | |
| 56 | #define oo_STRUCTcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:56:9`!(Type, x) \ |
| 57 | if (! our x. canWriteAsEncoding (encoding)) \ |
| 58 | return false; |
| 59 | |
| 60 | #define oo_STRUCT_SETcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:60:9`!(Type, x, setType) \ |
| 61 | for (int _i = 0; _i <= (int) setType::MAX; _i ++) { \ |
| 62 | if (! our x [_i]. canWriteAsEncoding (encoding)) \ |
| 63 | return false; \ |
| 64 | } |
| 65 | |
| 66 | #define oo_STRUCTVECcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:66:9`!(Type, x, sizeExpression) \ |
| 67 | { \ |
| 68 | const integer _size = (sizeExpression); \ |
| 69 | Melder_assert (_size == our x.size); \ |
| 70 | for (integer _i = 1; _i <= _size; _i ++) { \ |
| 71 | if (! our x [_i]. canWriteAsEncoding (encoding)) \ |
| 72 | return false; \ |
| 73 | } \ |
| 74 | } |
| 75 | |
| 76 | #define oo_STRUCTMATcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:76:9`!(Type, x, nrowExpression, ncolExpression) \ |
| 77 | { \ |
| 78 | const integer _nrow = (nrowExpression), _ncol = (nrowExpression); \ |
| 79 | Melder_assert (_nrow == our x.nrow && _ncol == our x.ncol); \ |
| 80 | for (integer _irow = 1; _irow <= _nrow; _irow ++) { \ |
| 81 | for (integer _icol = 1; _icol <= _ncol; _icol ++) { \ |
| 82 | if (! our x [_irow] [_icol]. canWriteAsEncoding (encoding)) \ |
| 83 | return false; \ |
| 84 | } \ |
| 85 | } \ |
| 86 | } |
| 87 | |
| 88 | #define oo_OBJECTcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:88:9`!(Class, version, x) \ |
| 89 | if (our x && ! Data_canWriteAsEncoding (our x.get(), encoding)) \ |
| 90 | return false; |
| 91 | |
| 92 | #define oo_COLLECTION_OFcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:92:9`!(Class, x, ItemClass, version) \ |
| 93 | for (integer _i = 1; _i <= x.size; _i ++) { \ |
| 94 | if (our x.at [_i] && ! Data_canWriteAsEncoding (our x.at [_i], encoding)) \ |
| 95 | return false; \ |
| 96 | } |
| 97 | |
| 98 | #define oo_COLLECTIONcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:98:9`!(Class, x, ItemClass, version) \ |
| 99 | if (our x && ! Data_canWriteAsEncoding (our x.get(), encoding)) \ |
| 100 | return false; |
| 101 | |
| 102 | #define oo_TRANSIENT_FILEcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:102:9`!(x) \ |
| 103 | return true; // because it won't actually be written |
| 104 | |
| 105 | #define oo_TRANSIENT_FOLDERcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:105:9`!(x) \ |
| 106 | return true; // because it won't actually be written |
| 107 | |
| 108 | #define oo_UNSAFE_BORROWED_TRANSIENT_CONST_OBJECT_REFERENCEcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:108:9`!(Class, x) \ |
| 109 | return true; // because it won't actually be written |
| 110 | |
| 111 | #define oo_UNSAFE_BORROWED_TRANSIENT_MUTABLE_OBJECT_REFERENCEcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:111:9`!(Class, x) \ |
| 112 | return true; // because it won't actually be written |
| 113 | |
| 114 | #define oo_DEFINE_STRUCTcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:114:9`!(Type) \ |
| 115 | bool struct##Type :: canWriteAsEncoding (int encoding) { \ |
| 116 | (void) encoding; |
| 117 | |
| 118 | #define oo_END_STRUCTcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:118:9`!(Type) \ |
| 119 | return true; \ |
| 120 | } |
| 121 | |
| 122 | #define oo_DEFINE_CLASScxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:122:9`!(Class, Parent) \ |
| 123 | bool struct##Class :: v1_canWriteAsEncoding (int encoding) { \ |
| 124 | if (! Class##_Parent :: v1_canWriteAsEncoding (encoding)) \ |
| 125 | return false; |
| 126 | |
| 127 | #define oo_END_CLASScxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:127:9`!(Class) \ |
| 128 | return true; \ |
| 129 | } |
| 130 | |
| 131 | #define oo_FROMcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:131:9`!(from) |
| 132 | |
| 133 | #define oo_ENDFROMcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:133:9`! |
| 134 | |
| 135 | #define oo_DECLARINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:135:9`! 0 |
| 136 | #define oo_DESTROYINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:136:9`! 0 |
| 137 | #define oo_COPYINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:137:9`! 0 |
| 138 | #define oo_COMPARINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:138:9`! 0 |
| 139 | #define oo_VALIDATING_ENCODINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:139:9`! 1 |
| 140 | #define oo_READINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:140:9`! 0 |
| 141 | #define oo_READING_TEXTcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:141:9`! 0 |
| 142 | #define oo_READING_BINARYcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:142:9`! 0 |
| 143 | #define oo_WRITINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:143:9`! 0 |
| 144 | #define oo_WRITING_TEXTcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:144:9`! 0 |
| 145 | #define oo_WRITING_BINARYcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:145:9`! 0 |
| 146 | #define oo_DESCRIBINGcxx . . $ `sys/oo_CAN_WRITE_AS_ENCODING.h:146:9`! 0 |
| 147 | |
| 148 | /* End of file oo_CAN_WRITE_AS_ENCODING.h */ |