Changeset 11724
- Timestamp:
- Feb 8, 2007, 3:26:00 PM (19 years ago)
- Location:
- trunk/psLib/src/types
- Files:
-
- 2 edited
-
psMetadata.c (modified) (2 diffs)
-
psMetadata.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/types/psMetadata.c
r11706 r11724 12 12 * @author Ross Harman, MHPCC 13 13 * 14 * @version $Revision: 1.15 1$ $Name: not supported by cvs2svn $15 * @date $Date: 2007-02-0 8 21:17:02$14 * @version $Revision: 1.152 $ $Name: not supported by cvs2svn $ 15 * @date $Date: 2007-02-09 01:26:00 $ 16 16 * 17 17 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 492 492 493 493 // may need to extend this to change the keyname in the copy 494 bool psMetadataItemTransfer(psMetadata *out, 495 const psMetadata *in, 496 const char *key) 497 { 498 if (in == NULL) { 499 psError(PS_ERR_BAD_PARAMETER_NULL, true, 500 "psMetadataItemTransfer: 'in' cannot be NULL.\n"); 501 return false; 502 } 503 if (out == NULL) { 504 psError(PS_ERR_BAD_PARAMETER_NULL, true, 505 "psMetadataItemTransfer: 'out' cannot be NULL.\n"); 506 return false; 507 } 508 if (key == NULL) { 509 psError(PS_ERR_BAD_PARAMETER_NULL, true, 510 "psMetadataItemTransfer: 'key' cannot be NULL.\n"); 511 return false; 512 } 494 bool psMetadataItemSupplement(psMetadata *out, 495 const psMetadata *in, 496 const char *key) 497 { 498 PS_ASSERT_METADATA_NON_NULL(in, false); 499 PS_ASSERT_METADATA_NON_NULL(out, false); 500 PS_ASSERT_STRING_NON_EMPTY(key, false); 513 501 514 502 psMetadataItem *item = psMetadataLookup(in, key); 515 503 if (!item) { 516 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 517 "psMetadataItemTransfer: Could not find 'key' in psMetadata 'in'.\n"); 504 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Could not find '%s' in metadata.\n", key); 518 505 return false; 519 506 } 520 507 if (!psMetadataAddItem(out, item, PS_LIST_TAIL, PS_META_REPLACE) ) { 521 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 522 "psMetadataItemTransfer: Could not add item to psMetadata 'out'.\n"); 508 psError(PS_ERR_BAD_PARAMETER_VALUE, true, "Could not add %s to metadata.\n", key); 523 509 return false; 524 510 } -
trunk/psLib/src/types/psMetadata.h
r11706 r11724 9 9 * @author Ross Harman, MHPCC 10 10 * 11 * @version $Revision: 1.9 7$ $Name: not supported by cvs2svn $12 * @date $Date: 2007-02-0 8 21:17:02$11 * @version $Revision: 1.98 $ $Name: not supported by cvs2svn $ 12 * @date $Date: 2007-02-09 01:26:00 $ 13 13 * 14 14 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 480 480 481 481 482 /** Copy a metadata item from one psMetadata to another.483 * 484 * Creates a copy of a psMetadataItem from in and appends it to out. If out485 * is NULL, a new container is created.482 /** Supplements a metadata with an item from another metadata. 483 * 484 * Supplements the output metadata with the metadata item of the specified name from the input metadata. If 485 * out is NULL, a new container is created. 486 486 * 487 487 * @return bool: True if successful, otherwise false. 488 488 */ 489 bool psMetadataItem Transfer(489 bool psMetadataItemSupplement( 490 490 psMetadata *out, ///< output Metadata container for copying. 491 491 const psMetadata *in, ///< Metadata collection from which to copy.
Note:
See TracChangeset
for help on using the changeset viewer.
