Skip to content

Commit 5258c71

Browse files
Added covenience functions (#11)
* Removed duplicated literal "Empty array name" * Removed XMPMeta interface and merged this with the real class. * Removed duplicated literal "Empty property name" * Default value for PropertyOptions restored * @Suppress("TooManyFunctions") * Moved private methods to better places * Added convenience methods for common properties * ReadXmpTest.kt & WriteXmpTest.kt use convenience methods to get unit test coverage on that. * Removed sub package "impl" * XMPMeta.kt: Style formattings * Removed XMPIterator.kt interface as there is only one implementation. * Merged XMPSchemaRegistry.kt & XMPSchemaRegistryImpl.kt * Refactor XMPRDFWriter: Pass StringBuilder into the methods * Refactor XMPRDFWriter: Inlined write methods * Refactor XMPRDFWriter: Pass XMPMeta into serialize() * Refactor XMPRDFWriter: Pass SerializeOptions into serialize() * XMPRDFWriter is now a singleton object to avoid this instance creation
1 parent 0ff63fb commit 5258c71

29 files changed

Lines changed: 2530 additions & 2539 deletions

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ It's part of [Ashampoo Photos](https://ashampoo.com/photos).
1515
## Installation
1616

1717
```
18-
implementation("com.ashampoo:xmpcore:0.1.7")
18+
implementation("com.ashampoo:xmpcore:0.2")
1919
```
2020

2121
## How to use

src/commonMain/kotlin/com/ashampoo/xmp/impl/DomParser.kt renamed to src/commonMain/kotlin/com/ashampoo/xmp/DomParser.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
package com.ashampoo.xmp.impl
1+
package com.ashampoo.xmp
22

3-
import com.ashampoo.xmp.XMPError
4-
import com.ashampoo.xmp.XMPException
53
import nl.adaptivity.xmlutil.DomWriter
64
import nl.adaptivity.xmlutil.EventType
75
import nl.adaptivity.xmlutil.XmlStreaming

src/commonMain/kotlin/com/ashampoo/xmp/impl/QName.kt renamed to src/commonMain/kotlin/com/ashampoo/xmp/QName.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
77
// of the Adobe license agreement accompanying it.
88
// =================================================================================================
9-
package com.ashampoo.xmp.impl
9+
package com.ashampoo.xmp
1010

1111
class QName {
1212

src/commonMain/kotlin/com/ashampoo/xmp/impl/Utils.kt renamed to src/commonMain/kotlin/com/ashampoo/xmp/Utils.kt

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66
// NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the terms
77
// of the Adobe license agreement accompanying it.
88
// =================================================================================================
9-
package com.ashampoo.xmp.impl
10-
11-
import com.ashampoo.xmp.XMPConst
9+
package com.ashampoo.xmp
1210

1311
/**
1412
* Utility functions for the XMPToolkit implementation.

src/commonMain/kotlin/com/ashampoo/xmp/XMPConst.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,8 @@ object XMPConst {
290290

291291
const val XMP_DC_SUBJECT: String = "subject"
292292

293+
const val XMP_ACDSEE_KEYWORDS: String = "keywords"
294+
293295
const val XMP_IPTC_EXT_PERSON_IN_IMAGE: String = "PersonInImage"
294296

295297
}

src/commonMain/kotlin/com/ashampoo/xmp/XMPError.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ package com.ashampoo.xmp
1010

1111
object XMPError {
1212

13+
const val EMPTY_ARRAY_NAME_TEXT: String = "Empty array name"
1314
const val EMPTY_SCHEMA_TEXT: String = "Empty schema namespace URI"
15+
const val EMPTY_PROPERTY_NAME_TEXT: String = "Empty property name"
1416
const val EMPTY_CONVERT_STRING_TEXT: String = "Empty convert-string"
1517

1618
const val UNKNOWN: Int = 0

0 commit comments

Comments
 (0)