/src/exiv2/xmpsdk/src/WXMPMeta.cpp
Line | Count | Source |
1 | | // ================================================================================================= |
2 | | // Copyright 2002-2008 Adobe Systems Incorporated |
3 | | // All Rights Reserved. |
4 | | // |
5 | | // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms |
6 | | // of the Adobe license agreement accompanying it. |
7 | | // ================================================================================================= |
8 | | |
9 | | #include "XMP_Environment.h" // ! This must be the first include! |
10 | | #include "XMPCore_Impl.hpp" |
11 | | |
12 | | #include "XMPMeta.hpp" |
13 | | #include "client-glue/WXMPMeta.hpp" |
14 | | |
15 | | #if XMP_WinBuild |
16 | | #ifdef _MSC_VER |
17 | | #pragma warning ( disable : 4101 ) // unreferenced local variable |
18 | | #pragma warning ( disable : 4189 ) // local variable is initialized but not referenced |
19 | | #pragma warning ( disable : 4702 ) // unreachable code |
20 | | #pragma warning ( disable : 4800 ) // forcing value to bool 'true' or 'false' (performance warning) |
21 | | #if XMP_DebugBuild |
22 | | #pragma warning ( disable : 4297 ) // function assumed not to throw an exception but does |
23 | | #endif |
24 | | #endif |
25 | | #endif |
26 | | |
27 | | #if __cplusplus |
28 | | extern "C" { |
29 | | #endif |
30 | | |
31 | | // ================================================================================================= |
32 | | // Init/Term Wrappers |
33 | | // ================== |
34 | | |
35 | | /* class static */ void |
36 | | WXMPMeta_GetVersionInfo_1 ( XMP_VersionInfo * info ) |
37 | 0 | { |
38 | 0 | WXMP_Result * wResult = &void_wResult; // ! Needed to "fool" the EnterWrapper macro. |
39 | 0 | XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_GetVersionInfo_1" ) |
40 | |
|
41 | 0 | XMPMeta::GetVersionInfo ( info ); |
42 | |
|
43 | 0 | XMP_EXIT_WRAPPER_NO_THROW |
44 | 0 | } |
45 | | |
46 | | // ------------------------------------------------------------------------------------------------- |
47 | | |
48 | | /* class static */ void |
49 | | WXMPMeta_Initialize_1 ( WXMP_Result * wResult ) |
50 | 1 | { |
51 | 1 | XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Initialize_1" ) |
52 | | |
53 | 1 | bool ok = XMPMeta::Initialize(); |
54 | 1 | wResult->int32Result = ok; |
55 | | |
56 | 1 | XMP_EXIT_WRAPPER |
57 | 1 | } |
58 | | // ------------------------------------------------------------------------------------------------- |
59 | | |
60 | | /* class static */ void |
61 | | WXMPMeta_Terminate_1() |
62 | 1 | { |
63 | 1 | WXMP_Result * wResult = &void_wResult; // ! Needed to "fool" the EnterWrapper macro. |
64 | 1 | XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Terminate_1" ) |
65 | | |
66 | 1 | XMPMeta::Terminate(); |
67 | | |
68 | 1 | XMP_EXIT_WRAPPER_NO_THROW |
69 | 0 | } |
70 | | |
71 | | // ================================================================================================= |
72 | | // CTor/DTor Wrappers |
73 | | // ================== |
74 | | |
75 | | void |
76 | | WXMPMeta_CTor_1 ( WXMP_Result * wResult ) |
77 | 11.1k | { |
78 | 11.1k | XMP_ENTER_WRAPPER ( "WXMPMeta_CTor_1" ) |
79 | | |
80 | 11.1k | XMPMeta * xmpObj = new XMPMeta(); |
81 | 11.1k | ++xmpObj->clientRefs; |
82 | 11.1k | XMP_Assert ( xmpObj->clientRefs == 1 ); |
83 | 11.1k | wResult->ptrResult = XMPMetaRef ( xmpObj ); |
84 | | |
85 | 11.1k | XMP_EXIT_WRAPPER |
86 | 11.1k | } |
87 | | |
88 | | // ------------------------------------------------------------------------------------------------- |
89 | | |
90 | | void |
91 | | WXMPMeta_IncrementRefCount_1 ( XMPMetaRef xmpRef ) |
92 | 0 | { |
93 | 0 | WXMP_Result * wResult = &void_wResult; // ! Needed to "fool" the EnterWrapper macro. |
94 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_IncrementRefCount_1" ) |
95 | |
|
96 | 0 | XMPMeta * thiz = (XMPMeta*)xmpRef; |
97 | | |
98 | 0 | ++thiz->clientRefs; |
99 | 0 | XMP_Assert ( thiz->clientRefs > 0 ); |
100 | |
|
101 | 0 | XMP_EXIT_WRAPPER_NO_THROW |
102 | 0 | } |
103 | | |
104 | | // ------------------------------------------------------------------------------------------------- |
105 | | |
106 | | void |
107 | | WXMPMeta_DecrementRefCount_1 ( XMPMetaRef xmpRef ) |
108 | 11.1k | { |
109 | 11.1k | WXMP_Result * wResult = &void_wResult; // ! Needed to "fool" the EnterWrapper macro. |
110 | 11.1k | XMP_ENTER_WRAPPER ( "WXMPMeta_DecrementRefCount_1" ) |
111 | | |
112 | 11.1k | XMPMeta * thiz = (XMPMeta*)xmpRef; |
113 | | |
114 | 11.1k | XMP_Assert ( thiz->clientRefs > 0 ); |
115 | 11.1k | --thiz->clientRefs; |
116 | 11.1k | if ( thiz->clientRefs <= 0 ) delete ( thiz ); |
117 | | |
118 | 11.1k | XMP_EXIT_WRAPPER_NO_THROW |
119 | 11.1k | } |
120 | | |
121 | | // ================================================================================================= |
122 | | // Class Static Wrappers |
123 | | // ===================== |
124 | | // |
125 | | // These are DLL-entry wrappers for class-static functions. They all follow a simple pattern: |
126 | | // |
127 | | // try |
128 | | // acquire toolbox lock |
129 | | // validate parameters |
130 | | // call through to the implementation |
131 | | // retain toolbox lock if necessary |
132 | | // catch anything and return an appropriate XMP_Error object |
133 | | // return null (no error if we get to here) |
134 | | // |
135 | | // The toolbox lock is acquired through a local wrapper object that automatically unlocks when the |
136 | | // try-block is exited. The lock must be retained if the function is returning a string result. The |
137 | | // output string is owned by the toolkit, the client must copy the string then release the lock. |
138 | | // The lock used here is the overall toolkit lock. For simplicity at this time the lock is a simple |
139 | | // mutual exclusion lock, we do not allow multiple concurrent readers. |
140 | | // |
141 | | // The one exception to this model is UnlockToolkit. It does not acquire the toolkit lock since this |
142 | | // is the function the client calls to release the lock after copying an output string! |
143 | | // |
144 | | // ================================================================================================= |
145 | | |
146 | | /* class static */ void |
147 | | WXMPMeta_GetGlobalOptions_1 ( WXMP_Result * wResult ) |
148 | 0 | { |
149 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetGlobalOptions_1" ) |
150 | |
|
151 | 0 | XMP_OptionBits options = XMPMeta::GetGlobalOptions(); |
152 | 0 | wResult->int32Result = options; |
153 | |
|
154 | 0 | XMP_EXIT_WRAPPER |
155 | 0 | } |
156 | | |
157 | | // ------------------------------------------------------------------------------------------------- |
158 | | |
159 | | /* class static */ void |
160 | | WXMPMeta_SetGlobalOptions_1 ( XMP_OptionBits options, |
161 | | WXMP_Result * wResult ) |
162 | 0 | { |
163 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetGlobalOptions_1" ) |
164 | |
|
165 | 0 | XMPMeta::SetGlobalOptions ( options ); |
166 | |
|
167 | 0 | XMP_EXIT_WRAPPER |
168 | 0 | } |
169 | | // ------------------------------------------------------------------------------------------------- |
170 | | |
171 | | /* class static */ void |
172 | | WXMPMeta_DumpNamespaces_1 ( XMP_TextOutputProc outProc, |
173 | | void * refCon, |
174 | | WXMP_Result * wResult ) |
175 | 0 | { |
176 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DumpNamespaces_1" ) |
177 | |
|
178 | 0 | if ( outProc == 0 ) XMP_Throw ( "Null client output routine", kXMPErr_BadParam ); |
179 | | |
180 | 0 | XMP_Status status = XMPMeta::DumpNamespaces ( outProc, refCon ); |
181 | 0 | wResult->int32Result = status; |
182 | |
|
183 | 0 | XMP_EXIT_WRAPPER |
184 | 0 | } |
185 | | |
186 | | // ------------------------------------------------------------------------------------------------- |
187 | | |
188 | | /* class static */ void |
189 | | WXMPMeta_DumpAliases_1 ( XMP_TextOutputProc outProc, |
190 | | void * refCon, |
191 | | WXMP_Result * wResult ) |
192 | 0 | { |
193 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DumpAliases_1" ) |
194 | |
|
195 | 0 | if ( outProc == 0 ) XMP_Throw ( "Null client output routine", kXMPErr_BadParam ); |
196 | | |
197 | 0 | XMP_Status status = XMPMeta::DumpAliases ( outProc, refCon ); |
198 | 0 | wResult->int32Result = status; |
199 | |
|
200 | 0 | XMP_EXIT_WRAPPER |
201 | 0 | } |
202 | | |
203 | | // ------------------------------------------------------------------------------------------------- |
204 | | |
205 | | /* class static */ void |
206 | | WXMPMeta_Unlock_1 ( XMP_OptionBits options ) |
207 | 89.7k | { |
208 | 89.7k | WXMP_Result * wResult = &void_wResult; // ! Needed to "fool" the EnterWrapper macro. |
209 | 89.7k | XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_Unlock_1" ) |
210 | | |
211 | 89.7k | XMPMeta::Unlock ( options ); |
212 | | |
213 | 89.7k | XMP_EXIT_WRAPPER_NO_THROW |
214 | 89.7k | } |
215 | | |
216 | | // ------------------------------------------------------------------------------------------------- |
217 | | |
218 | | /* class static */ void |
219 | | WXMPMeta_RegisterNamespace_1 ( XMP_StringPtr namespaceURI, |
220 | | XMP_StringPtr prefix, |
221 | | WXMP_Result * wResult ) |
222 | 1.41k | { |
223 | 1.41k | XMP_ENTER_WRAPPER ( "WXMPMeta_RegisterNamespace_1" ) |
224 | | |
225 | 1.41k | if ( (namespaceURI == 0) || (*namespaceURI == 0) ) XMP_Throw ( "Empty namespace URI", kXMPErr_BadSchema ); |
226 | 1.41k | if ( (prefix == 0) || (*prefix == 0) ) XMP_Throw ( "Empty prefix", kXMPErr_BadSchema ); |
227 | | |
228 | 1.41k | XMPMeta::RegisterNamespace ( namespaceURI, prefix ); |
229 | | |
230 | 1.41k | XMP_EXIT_WRAPPER |
231 | 1.41k | } |
232 | | |
233 | | // ------------------------------------------------------------------------------------------------- |
234 | | |
235 | | /* class static */ void |
236 | | WXMPMeta_GetNamespacePrefix_1 ( XMP_StringPtr namespaceURI, |
237 | | XMP_StringPtr * namespacePrefix, |
238 | | XMP_StringLen * prefixSize, |
239 | | WXMP_Result * wResult ) |
240 | 90.7k | { |
241 | 90.7k | XMP_ENTER_WRAPPER ( "WXMPMeta_GetNamespacePrefix_1" ) |
242 | | |
243 | 90.7k | if ( (namespaceURI == 0) || (*namespaceURI == 0) ) XMP_Throw ( "Empty namespace URI", kXMPErr_BadSchema ); |
244 | | |
245 | 90.7k | if ( namespacePrefix == 0 ) namespacePrefix = &voidStringPtr; |
246 | 90.7k | if ( prefixSize == 0 ) prefixSize = &voidStringLen; |
247 | | |
248 | 90.7k | bool found = XMPMeta::GetNamespacePrefix ( namespaceURI, namespacePrefix, prefixSize ); |
249 | 90.7k | wResult->int32Result = found; |
250 | | |
251 | 90.7k | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
252 | 90.7k | } |
253 | | |
254 | | // ------------------------------------------------------------------------------------------------- |
255 | | |
256 | | /* class static */ void |
257 | | WXMPMeta_GetNamespaceURI_1 ( XMP_StringPtr namespacePrefix, |
258 | | XMP_StringPtr * namespaceURI, |
259 | | XMP_StringLen * uriSize, |
260 | | WXMP_Result * wResult ) |
261 | 0 | { |
262 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetNamespaceURI_1" ) |
263 | |
|
264 | 0 | if ( (namespacePrefix == 0) || (*namespacePrefix == 0) ) XMP_Throw ( "Empty namespace prefix", kXMPErr_BadSchema ); |
265 | |
|
266 | 0 | if ( namespaceURI == 0 ) namespaceURI = &voidStringPtr; |
267 | 0 | if ( uriSize == 0 ) uriSize = &voidStringLen; |
268 | | |
269 | 0 | bool found = XMPMeta::GetNamespaceURI ( namespacePrefix, namespaceURI, uriSize ); |
270 | 0 | wResult->int32Result = found; |
271 | |
|
272 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
273 | 0 | } |
274 | | |
275 | | // ------------------------------------------------------------------------------------------------- |
276 | | |
277 | | /* class static */ void |
278 | | WXMPMeta_DeleteNamespace_1 ( XMP_StringPtr namespaceURI, |
279 | | WXMP_Result * wResult ) |
280 | 1.39k | { |
281 | 1.39k | XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteNamespace_1" ) |
282 | | |
283 | 1.39k | if ( (namespaceURI == 0) || (*namespaceURI == 0) ) XMP_Throw ( "Empty namespace URI", kXMPErr_BadSchema ); |
284 | | |
285 | 1.39k | XMPMeta::DeleteNamespace ( namespaceURI ); |
286 | | |
287 | 1.39k | XMP_EXIT_WRAPPER |
288 | 1.39k | } |
289 | | |
290 | | // ------------------------------------------------------------------------------------------------- |
291 | | |
292 | | /* class static */ void |
293 | | WXMPMeta_RegisterAlias_1 ( XMP_StringPtr aliasNS, |
294 | | XMP_StringPtr aliasProp, |
295 | | XMP_StringPtr actualNS, |
296 | | XMP_StringPtr actualProp, |
297 | | XMP_OptionBits arrayForm, |
298 | | WXMP_Result * wResult ) |
299 | 0 | { |
300 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_RegisterAlias_1" ) |
301 | |
|
302 | 0 | if ( (aliasNS == 0) || (*aliasNS == 0) ) XMP_Throw ( "Empty alias namespace URI", kXMPErr_BadSchema ); |
303 | 0 | if ( (aliasProp == 0) || (*aliasProp == 0) ) XMP_Throw ( "Empty alias property name", kXMPErr_BadXPath ); |
304 | 0 | if ( (actualNS == 0) || (*actualNS == 0) ) XMP_Throw ( "Empty actual namespace URI", kXMPErr_BadSchema ); |
305 | 0 | if ( (actualProp == 0) || (*actualProp == 0) ) XMP_Throw ( "Empty actual property name", kXMPErr_BadXPath ); |
306 | |
|
307 | 0 | XMPMeta::RegisterAlias ( aliasNS, aliasProp, actualNS, actualProp, arrayForm ); |
308 | |
|
309 | 0 | XMP_EXIT_WRAPPER |
310 | 0 | } |
311 | | |
312 | | // ------------------------------------------------------------------------------------------------- |
313 | | |
314 | | /* class static */ void |
315 | | WXMPMeta_ResolveAlias_1 ( XMP_StringPtr aliasNS, |
316 | | XMP_StringPtr aliasProp, |
317 | | XMP_StringPtr * actualNS, |
318 | | XMP_StringLen * nsSize, |
319 | | XMP_StringPtr * actualProp, |
320 | | XMP_StringLen * propSize, |
321 | | XMP_OptionBits * arrayForm, |
322 | | WXMP_Result * wResult ) |
323 | 0 | { |
324 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_ResolveAlias_1" ) |
325 | | |
326 | 0 | if ( (aliasNS == 0) || (*aliasNS == 0) ) XMP_Throw ( "Empty alias namespace URI", kXMPErr_BadSchema ); |
327 | 0 | if ( (aliasProp == 0) || (*aliasProp == 0) ) XMP_Throw ( "Empty alias property name", kXMPErr_BadXPath ); |
328 | | |
329 | 0 | if ( actualNS == 0 ) actualNS = &voidStringPtr; |
330 | 0 | if ( nsSize == 0 ) nsSize = &voidStringLen; |
331 | 0 | if ( actualProp == 0 ) actualProp = &voidStringPtr; |
332 | 0 | if ( propSize == 0 ) propSize = &voidStringLen; |
333 | 0 | if ( arrayForm == 0 ) arrayForm = &voidOptionBits; |
334 | | |
335 | 0 | bool found = XMPMeta::ResolveAlias ( aliasNS, aliasProp, actualNS, nsSize, actualProp, propSize, arrayForm ); |
336 | 0 | wResult->int32Result = found; |
337 | |
|
338 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
339 | 0 | } |
340 | | |
341 | | // ------------------------------------------------------------------------------------------------- |
342 | | |
343 | | /* class static */ void |
344 | | WXMPMeta_DeleteAlias_1 ( XMP_StringPtr aliasNS, |
345 | | XMP_StringPtr aliasProp, |
346 | | WXMP_Result * wResult ) |
347 | 0 | { |
348 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteAlias_1" ) |
349 | |
|
350 | 0 | if ( (aliasNS == 0) || (*aliasNS == 0) ) XMP_Throw ( "Empty alias namespace URI", kXMPErr_BadSchema ); |
351 | 0 | if ( (aliasProp == 0) || (*aliasProp == 0) ) XMP_Throw ( "Empty alias property name", kXMPErr_BadXPath ); |
352 | |
|
353 | 0 | XMPMeta::DeleteAlias ( aliasNS, aliasProp ); |
354 | |
|
355 | 0 | XMP_EXIT_WRAPPER |
356 | 0 | } |
357 | | |
358 | | // ------------------------------------------------------------------------------------------------- |
359 | | |
360 | | /* class static */ void |
361 | | WXMPMeta_RegisterStandardAliases_1 ( XMP_StringPtr schemaNS, |
362 | | WXMP_Result * wResult ) |
363 | 0 | { |
364 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_RegisterStandardAliases_1" ) |
365 | |
|
366 | 0 | if ( schemaNS == 0 ) schemaNS = ""; |
367 | |
|
368 | 0 | XMPMeta::RegisterStandardAliases ( schemaNS ); |
369 | |
|
370 | 0 | XMP_EXIT_WRAPPER |
371 | 0 | } |
372 | | |
373 | | // ================================================================================================= |
374 | | // Class Method Wrappers |
375 | | // ===================== |
376 | | // |
377 | | // These are DLL-entry wrappers for the methods. They all follow a simple pattern: |
378 | | // |
379 | | // validate parameters |
380 | | // try |
381 | | // acquire object lock |
382 | | // call through to the implementation |
383 | | // retain object lock if necessary |
384 | | // catch anything and return an appropriate XMP_Error object |
385 | | // return null (no error if we get to here) |
386 | | // |
387 | | // The object lock is acquired through a local wrapper object that automatically unlocks when the |
388 | | // try-block is exited. The lock must be retained if the function is returning a string result. The |
389 | | // output string is owned by the object, the client must copy the string then release the lock. The |
390 | | // lock used here is the per-object lock. For simplicity at this time the lock is a simple mutual |
391 | | // exclusion lock, we do not allow multiple concurrent readers. |
392 | | // |
393 | | // The one exception to this model is UnlockObject. It does not acquire the object lock since this |
394 | | // is the function the client calls to release the lock after copying an output string! |
395 | | // |
396 | | // ================================================================================================= |
397 | | |
398 | | void |
399 | | WXMPMeta_GetProperty_1 ( XMPMetaRef xmpRef, |
400 | | XMP_StringPtr schemaNS, |
401 | | XMP_StringPtr propName, |
402 | | XMP_StringPtr * propValue, |
403 | | XMP_StringLen * valueSize, |
404 | | XMP_OptionBits * options, |
405 | | WXMP_Result * wResult ) /* const */ |
406 | 0 | { |
407 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetProperty_1" ) |
408 | | |
409 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
410 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
411 | | |
412 | 0 | if ( propValue == 0 ) propValue = &voidStringPtr; |
413 | 0 | if ( valueSize == 0 ) valueSize = &voidStringLen; |
414 | 0 | if ( options == 0 ) options = &voidOptionBits; |
415 | |
|
416 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
417 | 0 | bool found = meta.GetProperty ( schemaNS, propName, propValue, valueSize, options ); |
418 | 0 | wResult->int32Result = found; |
419 | |
|
420 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
421 | 0 | } |
422 | | |
423 | | // ------------------------------------------------------------------------------------------------- |
424 | | |
425 | | void |
426 | | WXMPMeta_GetArrayItem_1 ( XMPMetaRef xmpRef, |
427 | | XMP_StringPtr schemaNS, |
428 | | XMP_StringPtr arrayName, |
429 | | XMP_Index itemIndex, |
430 | | XMP_StringPtr * itemValue, |
431 | | XMP_StringLen * valueSize, |
432 | | XMP_OptionBits * options, |
433 | | WXMP_Result * wResult ) /* const */ |
434 | 0 | { |
435 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetArrayItem_1" ) |
436 | | |
437 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
438 | 0 | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
439 | | |
440 | 0 | if ( itemValue == 0 ) itemValue = &voidStringPtr; |
441 | 0 | if ( valueSize == 0 ) valueSize = &voidStringLen; |
442 | 0 | if ( options == 0 ) options = &voidOptionBits; |
443 | |
|
444 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
445 | 0 | bool found = meta.GetArrayItem ( schemaNS, arrayName, itemIndex, itemValue, valueSize, options ); |
446 | 0 | wResult->int32Result = found; |
447 | |
|
448 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
449 | 0 | } |
450 | | |
451 | | // ------------------------------------------------------------------------------------------------- |
452 | | |
453 | | void |
454 | | WXMPMeta_GetStructField_1 ( XMPMetaRef xmpRef, |
455 | | XMP_StringPtr schemaNS, |
456 | | XMP_StringPtr structName, |
457 | | XMP_StringPtr fieldNS, |
458 | | XMP_StringPtr fieldName, |
459 | | XMP_StringPtr * fieldValue, |
460 | | XMP_StringLen * valueSize, |
461 | | XMP_OptionBits * options, |
462 | | WXMP_Result * wResult ) /* const */ |
463 | 0 | { |
464 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetStructField_1" ) |
465 | | |
466 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
467 | 0 | if ( (structName == 0) || (*structName == 0) ) XMP_Throw ( "Empty struct name", kXMPErr_BadXPath ); |
468 | 0 | if ( (fieldNS == 0) || (*fieldNS == 0) ) XMP_Throw ( "Empty field namespace URI", kXMPErr_BadSchema ); |
469 | 0 | if ( (fieldName == 0) || (*fieldName == 0) ) XMP_Throw ( "Empty field name", kXMPErr_BadXPath ); |
470 | | |
471 | 0 | if ( fieldValue == 0 ) fieldValue = &voidStringPtr; |
472 | 0 | if ( valueSize == 0 ) valueSize = &voidStringLen; |
473 | 0 | if ( options == 0 ) options = &voidOptionBits; |
474 | |
|
475 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
476 | 0 | bool found = meta.GetStructField ( schemaNS, structName, fieldNS, fieldName, fieldValue, valueSize, options ); |
477 | 0 | wResult->int32Result = found; |
478 | |
|
479 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
480 | 0 | } |
481 | | |
482 | | // ------------------------------------------------------------------------------------------------- |
483 | | |
484 | | void |
485 | | WXMPMeta_GetQualifier_1 ( XMPMetaRef xmpRef, |
486 | | XMP_StringPtr schemaNS, |
487 | | XMP_StringPtr propName, |
488 | | XMP_StringPtr qualNS, |
489 | | XMP_StringPtr qualName, |
490 | | XMP_StringPtr * qualValue, |
491 | | XMP_StringLen * valueSize, |
492 | | XMP_OptionBits * options, |
493 | | WXMP_Result * wResult ) /* const */ |
494 | 0 | { |
495 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetQualifier_1" ) |
496 | | |
497 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
498 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
499 | 0 | if ( (qualNS == 0) || (*qualNS == 0) ) XMP_Throw ( "Empty qualifier namespace URI", kXMPErr_BadSchema ); |
500 | 0 | if ( (qualName == 0) || (*qualName == 0) ) XMP_Throw ( "Empty qualifier name", kXMPErr_BadXPath ); |
501 | | |
502 | 0 | if ( qualValue == 0 ) qualValue = &voidStringPtr; |
503 | 0 | if ( valueSize == 0 ) valueSize = &voidStringLen; |
504 | 0 | if ( options == 0 ) options = &voidOptionBits; |
505 | |
|
506 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
507 | 0 | bool found = meta.GetQualifier ( schemaNS, propName, qualNS, qualName, qualValue, valueSize, options ); |
508 | 0 | wResult->int32Result = found; |
509 | |
|
510 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
511 | 0 | } |
512 | | |
513 | | // ------------------------------------------------------------------------------------------------- |
514 | | |
515 | | void |
516 | | WXMPMeta_SetProperty_1 ( XMPMetaRef xmpRef, |
517 | | XMP_StringPtr schemaNS, |
518 | | XMP_StringPtr propName, |
519 | | XMP_StringPtr propValue, |
520 | | XMP_OptionBits options, |
521 | | WXMP_Result * wResult ) |
522 | 179k | { |
523 | 179k | XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_1" ) |
524 | | |
525 | 179k | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
526 | 179k | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
527 | | |
528 | 179k | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
529 | 179k | meta->SetProperty ( schemaNS, propName, propValue, options ); |
530 | | |
531 | 179k | XMP_EXIT_WRAPPER |
532 | 179k | } |
533 | | |
534 | | // ------------------------------------------------------------------------------------------------- |
535 | | |
536 | | void |
537 | | WXMPMeta_SetArrayItem_1 ( XMPMetaRef xmpRef, |
538 | | XMP_StringPtr schemaNS, |
539 | | XMP_StringPtr arrayName, |
540 | | XMP_Index itemIndex, |
541 | | XMP_StringPtr itemValue, |
542 | | XMP_OptionBits options, |
543 | | WXMP_Result * wResult ) |
544 | 0 | { |
545 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetArrayItem_1" ) |
546 | |
|
547 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
548 | 0 | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
549 | |
|
550 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
551 | 0 | meta->SetArrayItem ( schemaNS, arrayName, itemIndex, itemValue, options ); |
552 | | |
553 | 0 | XMP_EXIT_WRAPPER |
554 | 0 | } |
555 | | |
556 | | // ------------------------------------------------------------------------------------------------- |
557 | | |
558 | | void |
559 | | WXMPMeta_AppendArrayItem_1 ( XMPMetaRef xmpRef, |
560 | | XMP_StringPtr schemaNS, |
561 | | XMP_StringPtr arrayName, |
562 | | XMP_OptionBits arrayOptions, |
563 | | XMP_StringPtr itemValue, |
564 | | XMP_OptionBits options, |
565 | | WXMP_Result * wResult ) |
566 | 3.90k | { |
567 | 3.90k | XMP_ENTER_WRAPPER ( "WXMPMeta_AppendArrayItem_1" ) |
568 | | |
569 | 3.90k | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
570 | 3.90k | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
571 | | |
572 | 3.90k | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
573 | 3.90k | meta->AppendArrayItem ( schemaNS, arrayName, arrayOptions, itemValue, options ); |
574 | | |
575 | 3.90k | XMP_EXIT_WRAPPER |
576 | 3.90k | } |
577 | | |
578 | | // ------------------------------------------------------------------------------------------------- |
579 | | |
580 | | void |
581 | | WXMPMeta_SetStructField_1 ( XMPMetaRef xmpRef, |
582 | | XMP_StringPtr schemaNS, |
583 | | XMP_StringPtr structName, |
584 | | XMP_StringPtr fieldNS, |
585 | | XMP_StringPtr fieldName, |
586 | | XMP_StringPtr fieldValue, |
587 | | XMP_OptionBits options, |
588 | | WXMP_Result * wResult ) |
589 | 0 | { |
590 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetStructField_1" ) |
591 | |
|
592 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
593 | 0 | if ( (structName == 0) || (*structName == 0) ) XMP_Throw ( "Empty struct name", kXMPErr_BadXPath ); |
594 | 0 | if ( (fieldNS == 0) || (*fieldNS == 0) ) XMP_Throw ( "Empty field namespace URI", kXMPErr_BadSchema ); |
595 | 0 | if ( (fieldName == 0) || (*fieldName == 0) ) XMP_Throw ( "Empty field name", kXMPErr_BadXPath ); |
596 | |
|
597 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
598 | 0 | meta->SetStructField ( schemaNS, structName, fieldNS, fieldName, fieldValue, options ); |
599 | | |
600 | 0 | XMP_EXIT_WRAPPER |
601 | 0 | } |
602 | | |
603 | | // ------------------------------------------------------------------------------------------------- |
604 | | |
605 | | void |
606 | | WXMPMeta_SetQualifier_1 ( XMPMetaRef xmpRef, |
607 | | XMP_StringPtr schemaNS, |
608 | | XMP_StringPtr propName, |
609 | | XMP_StringPtr qualNS, |
610 | | XMP_StringPtr qualName, |
611 | | XMP_StringPtr qualValue, |
612 | | XMP_OptionBits options, |
613 | | WXMP_Result * wResult ) |
614 | 3.90k | { |
615 | 3.90k | XMP_ENTER_WRAPPER ( "WXMPMeta_SetQualifier_1" ) |
616 | | |
617 | 3.90k | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
618 | 3.90k | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
619 | 3.90k | if ( (qualNS == 0) || (*qualNS == 0) ) XMP_Throw ( "Empty qualifier namespace URI", kXMPErr_BadSchema ); |
620 | 3.90k | if ( (qualName == 0) || (*qualName == 0) ) XMP_Throw ( "Empty qualifier name", kXMPErr_BadXPath ); |
621 | | |
622 | 3.90k | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
623 | 3.90k | meta->SetQualifier ( schemaNS, propName, qualNS, qualName, qualValue, options ); |
624 | | |
625 | 3.90k | XMP_EXIT_WRAPPER |
626 | 3.90k | } |
627 | | |
628 | | // ------------------------------------------------------------------------------------------------- |
629 | | |
630 | | void |
631 | | WXMPMeta_DeleteProperty_1 ( XMPMetaRef xmpRef, |
632 | | XMP_StringPtr schemaNS, |
633 | | XMP_StringPtr propName, |
634 | | WXMP_Result * wResult ) |
635 | 0 | { |
636 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteProperty_1" ) |
637 | | |
638 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
639 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
640 | |
|
641 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
642 | 0 | meta->DeleteProperty ( schemaNS, propName ); |
643 | | |
644 | 0 | XMP_EXIT_WRAPPER |
645 | 0 | } |
646 | | |
647 | | // ------------------------------------------------------------------------------------------------- |
648 | | |
649 | | void |
650 | | WXMPMeta_DeleteArrayItem_1 ( XMPMetaRef xmpRef, |
651 | | XMP_StringPtr schemaNS, |
652 | | XMP_StringPtr arrayName, |
653 | | XMP_Index itemIndex, |
654 | | WXMP_Result * wResult ) |
655 | 0 | { |
656 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteArrayItem_1" ) |
657 | |
|
658 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
659 | 0 | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
660 | |
|
661 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
662 | 0 | meta->DeleteArrayItem ( schemaNS, arrayName, itemIndex ); |
663 | | |
664 | 0 | XMP_EXIT_WRAPPER |
665 | 0 | } |
666 | | |
667 | | // ------------------------------------------------------------------------------------------------- |
668 | | |
669 | | void |
670 | | WXMPMeta_DeleteStructField_1 ( XMPMetaRef xmpRef, |
671 | | XMP_StringPtr schemaNS, |
672 | | XMP_StringPtr structName, |
673 | | XMP_StringPtr fieldNS, |
674 | | XMP_StringPtr fieldName, |
675 | | WXMP_Result * wResult ) |
676 | 0 | { |
677 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteStructField_1" ) |
678 | |
|
679 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
680 | 0 | if ( (structName == 0) || (*structName == 0) ) XMP_Throw ( "Empty struct name", kXMPErr_BadXPath ); |
681 | 0 | if ( (fieldNS == 0) || (*fieldNS == 0) ) XMP_Throw ( "Empty field namespace URI", kXMPErr_BadSchema ); |
682 | 0 | if ( (fieldName == 0) || (*fieldName == 0) ) XMP_Throw ( "Empty field name", kXMPErr_BadXPath ); |
683 | |
|
684 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
685 | 0 | meta->DeleteStructField ( schemaNS, structName, fieldNS, fieldName ); |
686 | | |
687 | 0 | XMP_EXIT_WRAPPER |
688 | 0 | } |
689 | | |
690 | | // ------------------------------------------------------------------------------------------------- |
691 | | |
692 | | void |
693 | | WXMPMeta_DeleteQualifier_1 ( XMPMetaRef xmpRef, |
694 | | XMP_StringPtr schemaNS, |
695 | | XMP_StringPtr propName, |
696 | | XMP_StringPtr qualNS, |
697 | | XMP_StringPtr qualName, |
698 | | WXMP_Result * wResult ) |
699 | 0 | { |
700 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DeleteQualifier_1" ) |
701 | |
|
702 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
703 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
704 | 0 | if ( (qualNS == 0) || (*qualNS == 0) ) XMP_Throw ( "Empty qualifier namespace URI", kXMPErr_BadSchema ); |
705 | 0 | if ( (qualName == 0) || (*qualName == 0) ) XMP_Throw ( "Empty qualifier name", kXMPErr_BadXPath ); |
706 | |
|
707 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
708 | 0 | meta->DeleteQualifier ( schemaNS, propName, qualNS, qualName ); |
709 | | |
710 | 0 | XMP_EXIT_WRAPPER |
711 | 0 | } |
712 | | |
713 | | // ------------------------------------------------------------------------------------------------- |
714 | | |
715 | | void |
716 | | WXMPMeta_DoesPropertyExist_1 ( XMPMetaRef xmpRef, |
717 | | XMP_StringPtr schemaNS, |
718 | | XMP_StringPtr propName, |
719 | | WXMP_Result * wResult ) /* const */ |
720 | 0 | { |
721 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DoesPropertyExist_1" ) |
722 | | |
723 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
724 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
725 | |
|
726 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
727 | 0 | bool found = meta.DoesPropertyExist ( schemaNS, propName ); |
728 | 0 | wResult->int32Result = found; |
729 | | |
730 | 0 | XMP_EXIT_WRAPPER |
731 | 0 | } |
732 | | |
733 | | // ------------------------------------------------------------------------------------------------- |
734 | | |
735 | | void |
736 | | WXMPMeta_DoesArrayItemExist_1 ( XMPMetaRef xmpRef, |
737 | | XMP_StringPtr schemaNS, |
738 | | XMP_StringPtr arrayName, |
739 | | XMP_Index itemIndex, |
740 | | WXMP_Result * wResult ) /* const */ |
741 | 0 | { |
742 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DoesArrayItemExist_1" ) |
743 | | |
744 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
745 | 0 | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
746 | |
|
747 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
748 | 0 | bool found = meta.DoesArrayItemExist ( schemaNS, arrayName, itemIndex ); |
749 | 0 | wResult->int32Result = found; |
750 | | |
751 | 0 | XMP_EXIT_WRAPPER |
752 | 0 | } |
753 | | |
754 | | // ------------------------------------------------------------------------------------------------- |
755 | | |
756 | | void |
757 | | WXMPMeta_DoesStructFieldExist_1 ( XMPMetaRef xmpRef, |
758 | | XMP_StringPtr schemaNS, |
759 | | XMP_StringPtr structName, |
760 | | XMP_StringPtr fieldNS, |
761 | | XMP_StringPtr fieldName, |
762 | | WXMP_Result * wResult ) /* const */ |
763 | 0 | { |
764 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DoesStructFieldExist_1" ) |
765 | |
|
766 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
767 | 0 | if ( (structName == 0) || (*structName == 0) ) XMP_Throw ( "Empty struct name", kXMPErr_BadXPath ); |
768 | 0 | if ( (fieldNS == 0) || (*fieldNS == 0) ) XMP_Throw ( "Empty field namespace URI", kXMPErr_BadSchema ); |
769 | 0 | if ( (fieldName == 0) || (*fieldName == 0) ) XMP_Throw ( "Empty field name", kXMPErr_BadXPath ); |
770 | |
|
771 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
772 | 0 | bool found = meta.DoesStructFieldExist ( schemaNS, structName, fieldNS, fieldName ); |
773 | 0 | wResult->int32Result = found; |
774 | | |
775 | 0 | XMP_EXIT_WRAPPER |
776 | 0 | } |
777 | | |
778 | | // ------------------------------------------------------------------------------------------------- |
779 | | |
780 | | void |
781 | | WXMPMeta_DoesQualifierExist_1 ( XMPMetaRef xmpRef, |
782 | | XMP_StringPtr schemaNS, |
783 | | XMP_StringPtr propName, |
784 | | XMP_StringPtr qualNS, |
785 | | XMP_StringPtr qualName, |
786 | | WXMP_Result * wResult ) /* const */ |
787 | 0 | { |
788 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DoesQualifierExist_1" ) |
789 | |
|
790 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
791 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
792 | 0 | if ( (qualNS == 0) || (*qualNS == 0) ) XMP_Throw ( "Empty qualifier namespace URI", kXMPErr_BadSchema ); |
793 | 0 | if ( (qualName == 0) || (*qualName == 0) ) XMP_Throw ( "Empty qualifier name", kXMPErr_BadXPath ); |
794 | |
|
795 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
796 | 0 | bool found = meta.DoesQualifierExist ( schemaNS, propName, qualNS, qualName ); |
797 | 0 | wResult->int32Result = found; |
798 | | |
799 | 0 | XMP_EXIT_WRAPPER |
800 | 0 | } |
801 | | |
802 | | // ------------------------------------------------------------------------------------------------- |
803 | | |
804 | | void |
805 | | WXMPMeta_GetLocalizedText_1 ( XMPMetaRef xmpRef, |
806 | | XMP_StringPtr schemaNS, |
807 | | XMP_StringPtr arrayName, |
808 | | XMP_StringPtr genericLang, |
809 | | XMP_StringPtr specificLang, |
810 | | XMP_StringPtr * actualLang, |
811 | | XMP_StringLen * langSize, |
812 | | XMP_StringPtr * itemValue, |
813 | | XMP_StringLen * valueSize, |
814 | | XMP_OptionBits * options, |
815 | | WXMP_Result * wResult ) /* const */ |
816 | 0 | { |
817 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetLocalizedText_1" ) |
818 | | |
819 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
820 | 0 | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
821 | 0 | if ( genericLang == 0 ) genericLang = ""; |
822 | 0 | if ( (specificLang == 0) ||(*specificLang == 0) ) XMP_Throw ( "Empty specific language", kXMPErr_BadParam ); |
823 | | |
824 | 0 | if ( actualLang == 0 ) actualLang = &voidStringPtr; |
825 | 0 | if ( langSize == 0 ) langSize = &voidStringLen; |
826 | 0 | if ( itemValue == 0 ) itemValue = &voidStringPtr; |
827 | 0 | if ( valueSize == 0 ) valueSize = &voidStringLen; |
828 | 0 | if ( options == 0 ) options = &voidOptionBits; |
829 | |
|
830 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
831 | 0 | bool found = meta.GetLocalizedText ( schemaNS, arrayName, genericLang, specificLang, |
832 | 0 | actualLang, langSize, itemValue, valueSize, options ); |
833 | 0 | wResult->int32Result = found; |
834 | |
|
835 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( found ) |
836 | 0 | } |
837 | | |
838 | | // ------------------------------------------------------------------------------------------------- |
839 | | |
840 | | void |
841 | | WXMPMeta_SetLocalizedText_1 ( XMPMetaRef xmpRef, |
842 | | XMP_StringPtr schemaNS, |
843 | | XMP_StringPtr arrayName, |
844 | | XMP_StringPtr genericLang, |
845 | | XMP_StringPtr specificLang, |
846 | | XMP_StringPtr itemValue, |
847 | | XMP_OptionBits options, |
848 | | WXMP_Result * wResult ) |
849 | 0 | { |
850 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetLocalizedText_1" ) |
851 | |
|
852 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
853 | 0 | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
854 | 0 | if ( genericLang == 0 ) genericLang = ""; |
855 | 0 | if ( (specificLang == 0) ||(*specificLang == 0) ) XMP_Throw ( "Empty specific language", kXMPErr_BadParam ); |
856 | 0 | if ( itemValue == 0 ) itemValue = ""; |
857 | |
|
858 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
859 | 0 | meta->SetLocalizedText ( schemaNS, arrayName, genericLang, specificLang, itemValue, options ); |
860 | | |
861 | 0 | XMP_EXIT_WRAPPER |
862 | 0 | } |
863 | | |
864 | | // ------------------------------------------------------------------------------------------------- |
865 | | |
866 | | void |
867 | | WXMPMeta_GetProperty_Bool_1 ( XMPMetaRef xmpRef, |
868 | | XMP_StringPtr schemaNS, |
869 | | XMP_StringPtr propName, |
870 | | XMP_Bool * propValue, |
871 | | XMP_OptionBits * options, |
872 | | WXMP_Result * wResult ) /* const */ |
873 | 0 | { |
874 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetProperty_Bool_1" ) |
875 | | |
876 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
877 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
878 | |
|
879 | 0 | if ( propValue == 0 ) propValue = &voidByte; |
880 | 0 | if ( options == 0 ) options = &voidOptionBits; |
881 | |
|
882 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
883 | 0 | bool value; |
884 | 0 | bool found = meta.GetProperty_Bool ( schemaNS, propName, &value, options ); |
885 | 0 | if ( propValue != 0 ) *propValue = value; |
886 | 0 | wResult->int32Result = found; |
887 | | |
888 | 0 | XMP_EXIT_WRAPPER |
889 | 0 | } |
890 | | |
891 | | // ------------------------------------------------------------------------------------------------- |
892 | | |
893 | | void |
894 | | WXMPMeta_GetProperty_Int_1 ( XMPMetaRef xmpRef, |
895 | | XMP_StringPtr schemaNS, |
896 | | XMP_StringPtr propName, |
897 | | XMP_Int32 * propValue, |
898 | | XMP_OptionBits * options, |
899 | | WXMP_Result * wResult ) /* const */ |
900 | 0 | { |
901 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetProperty_Int_1" ) |
902 | | |
903 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
904 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
905 | |
|
906 | 0 | if ( propValue == 0 ) propValue = &voidInt32; |
907 | 0 | if ( options == 0 ) options = &voidOptionBits; |
908 | |
|
909 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
910 | 0 | bool found = meta.GetProperty_Int ( schemaNS, propName, propValue, options ); |
911 | 0 | wResult->int32Result = found; |
912 | | |
913 | 0 | XMP_EXIT_WRAPPER |
914 | 0 | } |
915 | | |
916 | | // ------------------------------------------------------------------------------------------------- |
917 | | |
918 | | void |
919 | | WXMPMeta_GetProperty_Int64_1 ( XMPMetaRef xmpRef, |
920 | | XMP_StringPtr schemaNS, |
921 | | XMP_StringPtr propName, |
922 | | XMP_Int64 * propValue, |
923 | | XMP_OptionBits * options, |
924 | | WXMP_Result * wResult ) /* const */ |
925 | 0 | { |
926 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetProperty_Int64_1" ) |
927 | | |
928 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
929 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
930 | |
|
931 | 0 | if ( propValue == 0 ) propValue = &voidInt64; |
932 | 0 | if ( options == 0 ) options = &voidOptionBits; |
933 | |
|
934 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
935 | 0 | bool found = meta.GetProperty_Int64 ( schemaNS, propName, propValue, options ); |
936 | 0 | wResult->int32Result = found; |
937 | | |
938 | 0 | XMP_EXIT_WRAPPER |
939 | 0 | } |
940 | | |
941 | | // ------------------------------------------------------------------------------------------------- |
942 | | |
943 | | void |
944 | | WXMPMeta_GetProperty_Float_1 ( XMPMetaRef xmpRef, |
945 | | XMP_StringPtr schemaNS, |
946 | | XMP_StringPtr propName, |
947 | | double * propValue, |
948 | | XMP_OptionBits * options, |
949 | | WXMP_Result * wResult ) /* const */ |
950 | 0 | { |
951 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetProperty_Float_1" ) |
952 | | |
953 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
954 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
955 | |
|
956 | 0 | if ( propValue == 0 ) propValue = &voidDouble; |
957 | 0 | if ( options == 0 ) options = &voidOptionBits; |
958 | |
|
959 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
960 | 0 | bool found = meta.GetProperty_Float ( schemaNS, propName, propValue, options ); |
961 | 0 | wResult->int32Result = found; |
962 | | |
963 | 0 | XMP_EXIT_WRAPPER |
964 | 0 | } |
965 | | |
966 | | // ------------------------------------------------------------------------------------------------- |
967 | | |
968 | | void |
969 | | WXMPMeta_GetProperty_Date_1 ( XMPMetaRef xmpRef, |
970 | | XMP_StringPtr schemaNS, |
971 | | XMP_StringPtr propName, |
972 | | XMP_DateTime * propValue, |
973 | | XMP_OptionBits * options, |
974 | | WXMP_Result * wResult ) /* const */ |
975 | 0 | { |
976 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetProperty_Date_1" ) |
977 | | |
978 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
979 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
980 | |
|
981 | 0 | if ( propValue == 0 ) propValue = &voidDateTime; |
982 | 0 | if ( options == 0 ) options = &voidOptionBits; |
983 | |
|
984 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
985 | 0 | bool found = meta.GetProperty_Date ( schemaNS, propName, propValue, options ); |
986 | 0 | wResult->int32Result = found; |
987 | | |
988 | 0 | XMP_EXIT_WRAPPER |
989 | 0 | } |
990 | | |
991 | | // ------------------------------------------------------------------------------------------------- |
992 | | |
993 | | void |
994 | | WXMPMeta_SetProperty_Bool_1 ( XMPMetaRef xmpRef, |
995 | | XMP_StringPtr schemaNS, |
996 | | XMP_StringPtr propName, |
997 | | XMP_Bool propValue, |
998 | | XMP_OptionBits options, |
999 | | WXMP_Result * wResult ) |
1000 | 0 | { |
1001 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_Bool_1" ) |
1002 | | |
1003 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
1004 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
1005 | |
|
1006 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1007 | 0 | meta->SetProperty_Bool ( schemaNS, propName, propValue, options ); |
1008 | | |
1009 | 0 | XMP_EXIT_WRAPPER |
1010 | 0 | } |
1011 | | |
1012 | | // ------------------------------------------------------------------------------------------------- |
1013 | | |
1014 | | void |
1015 | | WXMPMeta_SetProperty_Int_1 ( XMPMetaRef xmpRef, |
1016 | | XMP_StringPtr schemaNS, |
1017 | | XMP_StringPtr propName, |
1018 | | XMP_Int32 propValue, |
1019 | | XMP_OptionBits options, |
1020 | | WXMP_Result * wResult ) |
1021 | 0 | { |
1022 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_Int_1" ) |
1023 | | |
1024 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
1025 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
1026 | |
|
1027 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1028 | 0 | meta->SetProperty_Int ( schemaNS, propName, propValue, options ); |
1029 | | |
1030 | 0 | XMP_EXIT_WRAPPER |
1031 | 0 | } |
1032 | | |
1033 | | // ------------------------------------------------------------------------------------------------- |
1034 | | |
1035 | | void |
1036 | | WXMPMeta_SetProperty_Int64_1 ( XMPMetaRef xmpRef, |
1037 | | XMP_StringPtr schemaNS, |
1038 | | XMP_StringPtr propName, |
1039 | | XMP_Int64 propValue, |
1040 | | XMP_OptionBits options, |
1041 | | WXMP_Result * wResult ) |
1042 | 0 | { |
1043 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_Int64_1" ) |
1044 | | |
1045 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
1046 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
1047 | |
|
1048 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1049 | 0 | meta->SetProperty_Int64 ( schemaNS, propName, propValue, options ); |
1050 | | |
1051 | 0 | XMP_EXIT_WRAPPER |
1052 | 0 | } |
1053 | | |
1054 | | // ------------------------------------------------------------------------------------------------- |
1055 | | |
1056 | | void |
1057 | | WXMPMeta_SetProperty_Float_1 ( XMPMetaRef xmpRef, |
1058 | | XMP_StringPtr schemaNS, |
1059 | | XMP_StringPtr propName, |
1060 | | double propValue, |
1061 | | XMP_OptionBits options, |
1062 | | WXMP_Result * wResult ) |
1063 | 0 | { |
1064 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_Float_1" ) |
1065 | | |
1066 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
1067 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
1068 | |
|
1069 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1070 | 0 | meta->SetProperty_Float ( schemaNS, propName, propValue, options ); |
1071 | | |
1072 | 0 | XMP_EXIT_WRAPPER |
1073 | 0 | } |
1074 | | |
1075 | | // ------------------------------------------------------------------------------------------------- |
1076 | | |
1077 | | void |
1078 | | WXMPMeta_SetProperty_Date_1 ( XMPMetaRef xmpRef, |
1079 | | XMP_StringPtr schemaNS, |
1080 | | XMP_StringPtr propName, |
1081 | | const XMP_DateTime & propValue, |
1082 | | XMP_OptionBits options, |
1083 | | WXMP_Result * wResult ) |
1084 | 0 | { |
1085 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetProperty_Date_1" ) |
1086 | | |
1087 | 0 | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
1088 | 0 | if ( (propName == 0) || (*propName == 0) ) XMP_Throw ( "Empty property name", kXMPErr_BadXPath ); |
1089 | |
|
1090 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1091 | 0 | meta->SetProperty_Date ( schemaNS, propName, propValue, options ); |
1092 | | |
1093 | 0 | XMP_EXIT_WRAPPER |
1094 | 0 | } |
1095 | | |
1096 | | // ------------------------------------------------------------------------------------------------- |
1097 | | |
1098 | | void |
1099 | | WXMPMeta_DumpObject_1 ( XMPMetaRef xmpRef, |
1100 | | XMP_TextOutputProc outProc, |
1101 | | void * refCon, |
1102 | | WXMP_Result * wResult ) /* const */ |
1103 | 0 | { |
1104 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_DumpObject_1" ) |
1105 | |
|
1106 | 0 | if ( outProc == 0 ) XMP_Throw ( "Null client output routine", kXMPErr_BadParam ); |
1107 | | |
1108 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
1109 | 0 | XMP_Status status = meta.DumpObject ( outProc, refCon ); |
1110 | 0 | wResult->int32Result = status; |
1111 | | |
1112 | 0 | XMP_EXIT_WRAPPER |
1113 | 0 | } |
1114 | | |
1115 | | // ------------------------------------------------------------------------------------------------- |
1116 | | |
1117 | | void |
1118 | | WXMPMeta_Sort_1 ( XMPMetaRef xmpRef, |
1119 | | WXMP_Result * wResult ) |
1120 | 0 | { |
1121 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_Sort_1" ) |
1122 | |
|
1123 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1124 | 0 | meta->Sort(); |
1125 | | |
1126 | 0 | XMP_EXIT_WRAPPER |
1127 | 0 | } |
1128 | | |
1129 | | // ------------------------------------------------------------------------------------------------- |
1130 | | |
1131 | | void |
1132 | | WXMPMeta_Erase_1 ( XMPMetaRef xmpRef, |
1133 | | WXMP_Result * wResult ) |
1134 | 0 | { |
1135 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_Erase_1" ) |
1136 | |
|
1137 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1138 | 0 | meta->Erase(); |
1139 | | |
1140 | 0 | XMP_EXIT_WRAPPER |
1141 | 0 | } |
1142 | | |
1143 | | // ------------------------------------------------------------------------------------------------- |
1144 | | |
1145 | | void |
1146 | | WXMPMeta_Clone_1 ( XMPMetaRef xmpRef, |
1147 | | XMP_OptionBits options, |
1148 | | WXMP_Result * wResult ) /* const */ |
1149 | 0 | { |
1150 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_Clone_1" ) |
1151 | |
|
1152 | 0 | const XMPMeta & xOriginal = WtoXMPMeta_Ref ( xmpRef ); |
1153 | 0 | XMPMeta * xClone = new XMPMeta; |
1154 | 0 | xOriginal.Clone ( xClone, options ); |
1155 | 0 | XMP_Assert ( xClone->clientRefs == 0 ); // ! Gets incremented in TXMPMeta::Clone. |
1156 | 0 | wResult->ptrResult = xClone; |
1157 | | |
1158 | 0 | XMP_EXIT_WRAPPER |
1159 | 0 | } |
1160 | | |
1161 | | // ------------------------------------------------------------------------------------------------- |
1162 | | |
1163 | | void |
1164 | | WXMPMeta_CountArrayItems_1 ( XMPMetaRef xmpRef, |
1165 | | XMP_StringPtr schemaNS, |
1166 | | XMP_StringPtr arrayName, |
1167 | | WXMP_Result * wResult ) /* const */ |
1168 | 3.43k | { |
1169 | 3.43k | XMP_ENTER_WRAPPER ( "WXMPMeta_CountArrayItems_1" ) |
1170 | | |
1171 | 3.43k | if ( (schemaNS == 0) || (*schemaNS == 0) ) XMP_Throw ( "Empty schema namespace URI", kXMPErr_BadSchema ); |
1172 | 3.43k | if ( (arrayName == 0) || (*arrayName == 0) ) XMP_Throw ( "Empty array name", kXMPErr_BadXPath ); |
1173 | | |
1174 | 3.43k | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
1175 | 3.43k | XMP_Index count = meta.CountArrayItems ( schemaNS, arrayName ); |
1176 | 3.43k | wResult->int32Result = count; |
1177 | | |
1178 | 3.43k | XMP_EXIT_WRAPPER |
1179 | 3.43k | } |
1180 | | |
1181 | | // ------------------------------------------------------------------------------------------------- |
1182 | | |
1183 | | void |
1184 | | WXMPMeta_UnlockObject_1 ( XMPMetaRef xmpRef, |
1185 | | XMP_OptionBits options ) /* const */ |
1186 | 3.89k | { |
1187 | 3.89k | WXMP_Result * wResult = &void_wResult; // ! Needed to "fool" the EnterWrapper macro. |
1188 | 3.89k | XMP_ENTER_WRAPPER_NO_LOCK ( "WXMPMeta_UnlockObject_1" ) |
1189 | | |
1190 | 3.89k | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
1191 | 3.89k | meta.UnlockObject ( options ); |
1192 | | |
1193 | 3.89k | XMP_EXIT_WRAPPER_NO_THROW |
1194 | 3.89k | } |
1195 | | |
1196 | | // ------------------------------------------------------------------------------------------------- |
1197 | | |
1198 | | void |
1199 | | WXMPMeta_GetObjectName_1 ( XMPMetaRef xmpRef, |
1200 | | XMP_StringPtr * namePtr, |
1201 | | XMP_StringLen * nameLen, |
1202 | | WXMP_Result * wResult ) /* const */ |
1203 | 0 | { |
1204 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetObjectName_1" ) |
1205 | |
|
1206 | 0 | if ( namePtr == 0 ) namePtr = &voidStringPtr; |
1207 | 0 | if ( nameLen == 0 ) nameLen = &voidStringLen; |
1208 | |
|
1209 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
1210 | 0 | meta.GetObjectName ( namePtr, nameLen ); |
1211 | | |
1212 | 0 | XMP_EXIT_WRAPPER_KEEP_LOCK ( true ) // ! Always keep the lock, a string is always returned! |
1213 | 0 | } |
1214 | | |
1215 | | // ------------------------------------------------------------------------------------------------- |
1216 | | |
1217 | | void |
1218 | | WXMPMeta_SetObjectName_1 ( XMPMetaRef xmpRef, |
1219 | | XMP_StringPtr name, |
1220 | | WXMP_Result * wResult ) |
1221 | 0 | { |
1222 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetObjectName_1" ) |
1223 | |
|
1224 | 0 | if ( name == 0 ) name = ""; |
1225 | |
|
1226 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1227 | 0 | meta->SetObjectName ( name ); |
1228 | | |
1229 | 0 | XMP_EXIT_WRAPPER |
1230 | 0 | } |
1231 | | |
1232 | | // ------------------------------------------------------------------------------------------------- |
1233 | | |
1234 | | void |
1235 | | WXMPMeta_GetObjectOptions_1 ( XMPMetaRef xmpRef, |
1236 | | WXMP_Result * wResult ) /* const */ |
1237 | 0 | { |
1238 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_GetObjectOptions_1" ) |
1239 | |
|
1240 | 0 | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
1241 | 0 | XMP_OptionBits options = meta.GetObjectOptions(); |
1242 | 0 | wResult->int32Result = options; |
1243 | | |
1244 | 0 | XMP_EXIT_WRAPPER |
1245 | 0 | } |
1246 | | |
1247 | | // ------------------------------------------------------------------------------------------------- |
1248 | | |
1249 | | void |
1250 | | WXMPMeta_SetObjectOptions_1 ( XMPMetaRef xmpRef, |
1251 | | XMP_OptionBits options, |
1252 | | WXMP_Result * wResult ) |
1253 | 0 | { |
1254 | 0 | XMP_ENTER_WRAPPER ( "WXMPMeta_SetObjectOptions_1" ) |
1255 | | |
1256 | 0 | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1257 | 0 | meta->SetObjectOptions ( options ); |
1258 | | |
1259 | 0 | XMP_EXIT_WRAPPER |
1260 | 0 | } |
1261 | | |
1262 | | // ------------------------------------------------------------------------------------------------- |
1263 | | |
1264 | | void |
1265 | | WXMPMeta_ParseFromBuffer_1 ( XMPMetaRef xmpRef, |
1266 | | XMP_StringPtr buffer, |
1267 | | XMP_StringLen bufferSize, |
1268 | | XMP_OptionBits options, |
1269 | | WXMP_Result * wResult ) |
1270 | 7.15k | { |
1271 | 7.15k | XMP_ENTER_WRAPPER ( "WXMPMeta_ParseFromBuffer_1" ) |
1272 | | |
1273 | 7.15k | XMPMeta * meta = WtoXMPMeta_Ptr ( xmpRef ); |
1274 | 7.15k | meta->ParseFromBuffer ( buffer, bufferSize, options ); |
1275 | | |
1276 | 7.15k | XMP_EXIT_WRAPPER |
1277 | 7.15k | } |
1278 | | |
1279 | | // ------------------------------------------------------------------------------------------------- |
1280 | | |
1281 | | void |
1282 | | WXMPMeta_SerializeToBuffer_1 ( XMPMetaRef xmpRef, |
1283 | | XMP_StringPtr * rdfString, |
1284 | | XMP_StringLen * rdfSize, |
1285 | | XMP_OptionBits options, |
1286 | | XMP_StringLen padding, |
1287 | | XMP_StringPtr newline, |
1288 | | XMP_StringPtr indent, |
1289 | | XMP_Index baseIndent, |
1290 | | WXMP_Result * wResult ) /* const */ |
1291 | 3.89k | { |
1292 | 3.89k | XMP_ENTER_WRAPPER ( "WXMPMeta_SerializeToBuffer_1" ) |
1293 | | |
1294 | 3.89k | if ( rdfString == 0 ) rdfString = &voidStringPtr; |
1295 | 3.89k | if ( rdfSize == 0 ) rdfSize = &voidStringLen; |
1296 | | |
1297 | 3.89k | if ( newline == 0 ) newline = ""; |
1298 | 3.89k | if ( indent == 0 ) indent = ""; |
1299 | | |
1300 | 3.89k | const XMPMeta & meta = WtoXMPMeta_Ref ( xmpRef ); |
1301 | 3.89k | meta.SerializeToBuffer ( rdfString, rdfSize, options, padding, newline, indent, baseIndent ); |
1302 | | |
1303 | 3.89k | XMP_EXIT_WRAPPER_KEEP_LOCK ( true ) // ! Always keep the lock, a string is always returned! |
1304 | 3.89k | } |
1305 | | |
1306 | | // ================================================================================================= |
1307 | | |
1308 | | #if __cplusplus |
1309 | | } /* extern "C" */ |
1310 | | #endif |