IOSAD-63 trying to use yml2 for PEPMessage
authorDirk Zimmermann <dirk@pep-project.org>
Fri, 10 Nov 2017 14:44:47 +0100
changeset 368bd89f3ec04f0
parent 367 7dedf5391bb3
child 369 8b9b9d8bb2aa
IOSAD-63 trying to use yml2 for PEPMessage
yml2/pEp_message.yml2
yml2/pEp_message_include.ysl2
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/yml2/pEp_message.yml2	Fri Nov 10 14:44:47 2017 +0100
     1.3 @@ -0,0 +1,13 @@
     1.4 +decl class +name;
     1.5 +decl property(name, type, nullability, key);
     1.6 +
     1.7 +class PEPMessage {
     1.8 +    property "messageID" type = "NSString *" key="id";
     1.9 +    property "direction" type = "PEP_msg_direction" key="outgoing";
    1.10 +    property "shortMessage" type = "NSString *" key="shortmsg";
    1.11 +    property "longMessage" type = "NSString *" key="longmsg";
    1.12 +    property "longMessageFormatted" type = "NSString *" key="longmsg_formatted";
    1.13 +    property "attachments" type = "NSArray *" key="attachments";
    1.14 +    property "sent" type = "NSDate *" key="sent";
    1.15 +    property "received" type = "NSDate *" key="recv";
    1.16 +}
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/yml2/pEp_message_include.ysl2	Fri Nov 10 14:44:47 2017 +0100
     2.3 @@ -0,0 +1,38 @@
     2.4 +include yslt.yml2
     2.5 +
     2.6 +tstylesheet {
     2.7 +  template "/" {
     2.8 +    apply "class", 0
     2.9 +  }
    2.10 +
    2.11 +  template "class" {//document "{@name}Base.h" {
    2.12 +    | //
    2.13 +    | //  «@name».h
    2.14 +    | //  pEpObjCAdapter
    2.15 +    | //
    2.16 +    | //  Created by Dirk Zimmermann on 10.11.17.
    2.17 +    | //  Copyright © 2017 p≡p. All rights reserved.
    2.18 +    | //
    2.19 +    |
    2.20 +    | #import <Foundation/Foundation.h>
    2.21 +    |
    2.22 +    | #import "PEPSessionProtocol.h"
    2.23 +    |
    2.24 +    | @interface PEPIdentity : NSObject
    2.25 +    |
    2.26 +    apply "property"
    2.27 +    |
    2.28 +    |
    2.29 +    | @end
    2.30 +  }
    2.31 +
    2.32 +  template "property" {
    2.33 +    choose {
    2.34 +      when "@nullability"
    2.35 +        | @property (nonatomic, «@nullability») «@type» «@name»;
    2.36 +      otherwise
    2.37 +        | @property (nonatomic) «@type» «@name»;
    2.38 +    }
    2.39 +  }
    2.40 +}
    2.41 +