-
Notifications
You must be signed in to change notification settings - Fork 112
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dynamic node encoding + new formatters + various fixes #70
Dynamic node encoding + new formatters + various fixes #70
Commits on Feb 6, 2019
-
Configuration menu - View commit details
-
Copy full SHA for 0a8a07a - Browse repository at this point
Copy the full SHA 0a8a07aView commit details -
KeyedEncoding: Add new string formatters, capitalized, lowercased, up…
…percased Some helpers to deal with converting auto-generated codable String values for instance variables to match some common XML key coding standards to the commonly used Swift camel casing - capitalzied: convert first letter to uppercase - uppercased: All letters uppercased - lowercased: All letters lowercased Support all types that conform to StringProtocol rather than just String
Configuration menu - View commit details
-
Copy full SHA for ae4d50a - Browse repository at this point
Copy the full SHA ae4d50aView commit details -
SharedBoxProtocol: Generalize for any Box inheritance
Use a type erased protocl inheritance strategy commonly used to provide default implimentation to avaoid issues with as? checks in generic protocols, while retaining reuse benefits of generic protocols
Configuration menu - View commit details
-
Copy full SHA for e65d30b - Browse repository at this point
Copy the full SHA e65d30bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 99fde81 - Browse repository at this point
Copy the full SHA 99fde81View commit details -
Element coding, remove empty brackets if element string value is empt…
…y string In the case where a codable provides an empty string for the codable string value for an instance variable an empty bracket was inserted which is invalid XML. ``` let attr = "bar" let value = "FOO" enum CodingKeys : String, CodingKey { case attr case value = "" } ``` Will be useful for unkeyed objects that contain only attributes eg; ```xml <box attr="bar"><>FOO</></box> <!-- Would now correctly become --> <box attr="bar">FOO</box> ```
Configuration menu - View commit details
-
Copy full SHA for 38b79a2 - Browse repository at this point
Copy the full SHA 38b79a2View commit details -
Add DynamicNodeEncoding protocol
DynamicNodeEncoding allows easily adding the ability to choose if iVars should be attribute or element encoded by inheriting DynamicNodeEncoding and implimenting a single static function in any Codable class or struct. This is simpler than the current method that requires a global dynamic encoding closure for every XMLEncoder instance. This allows changing the encoding where the data models live, rather than the creator of the XMLEncoder instance needing to have knowledge of all the possible structs and classes that the encoder might encounter at init time.
Configuration menu - View commit details
-
Copy full SHA for 0300dd1 - Browse repository at this point
Copy the full SHA 0300dd1View commit details -
XMLEncoder: Add both option to value encoding, refactor encoder
- refactor element and attribute encoders to closures for easier code reuse - Added type alias for encoding closures for clarity
Configuration menu - View commit details
-
Copy full SHA for 14549a6 - Browse repository at this point
Copy the full SHA 14549a6View commit details -
Configuration menu - View commit details
-
Copy full SHA for f8c594a - Browse repository at this point
Copy the full SHA f8c594aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2ee4b03 - Browse repository at this point
Copy the full SHA 2ee4b03View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5f6f8d - Browse repository at this point
Copy the full SHA f5f6f8dView commit details -
test: Add coding / decoding tests to DynamicNodeEncoding
Had removed them since I was testing intrinsics with attributes. Needed to wrap cateogy value in an element tag again. Also appears the hack for decoding nested arrays is no longer required so removed the complex decoding of Category
Configuration menu - View commit details
-
Copy full SHA for e86be14 - Browse repository at this point
Copy the full SHA e86be14View commit details -
Convrted BooksTest to DynamicNodeEncoding, tests string equality
Previous version of this test techncially passed on Encdode/Decode comparision sinve the structure values were the same, but the encoding make Book structs id an element, so the strings weren't equal. Modified the simplier single book test to check that the attributes are encoded to XML and match the original string (minus white space formatting)
Configuration menu - View commit details
-
Copy full SHA for 5e94557 - Browse repository at this point
Copy the full SHA 5e94557View commit details -
Configuration menu - View commit details
-
Copy full SHA for 39b5999 - Browse repository at this point
Copy the full SHA 39b5999View commit details -
Configuration menu - View commit details
-
Copy full SHA for f5a8578 - Browse repository at this point
Copy the full SHA f5a8578View commit details -
Configuration menu - View commit details
-
Copy full SHA for a110b83 - Browse repository at this point
Copy the full SHA a110b83View commit details -
Configuration menu - View commit details
-
Copy full SHA for f60bb38 - Browse repository at this point
Copy the full SHA f60bb38View commit details -
Configuration menu - View commit details
-
Copy full SHA for 110a66b - Browse repository at this point
Copy the full SHA 110a66bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2061b34 - Browse repository at this point
Copy the full SHA 2061b34View commit details
Commits on Feb 9, 2019
-
Configuration menu - View commit details
-
Copy full SHA for d29ce8f - Browse repository at this point
Copy the full SHA d29ce8fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 32f58ee - Browse repository at this point
Copy the full SHA 32f58eeView commit details