Browse Source

IOSAD-63 trying to use yml2 for PEPMessage

IOS-898
Dirk Zimmermann 4 years ago
parent
commit
b9899c7216
2 changed files with 51 additions and 0 deletions
  1. +13
    -0
      yml2/pEp_message.yml2
  2. +38
    -0
      yml2/pEp_message_include.ysl2

+ 13
- 0
yml2/pEp_message.yml2 View File

@ -0,0 +1,13 @@
decl class +name;
decl property(name, type, nullability, key);
class PEPMessage {
property "messageID" type = "NSString *" key="id";
property "direction" type = "PEP_msg_direction" key="outgoing";
property "shortMessage" type = "NSString *" key="shortmsg";
property "longMessage" type = "NSString *" key="longmsg";
property "longMessageFormatted" type = "NSString *" key="longmsg_formatted";
property "attachments" type = "NSArray *" key="attachments";
property "sent" type = "NSDate *" key="sent";
property "received" type = "NSDate *" key="recv";
}

+ 38
- 0
yml2/pEp_message_include.ysl2 View File

@ -0,0 +1,38 @@
include yslt.yml2
tstylesheet {
template "/" {
apply "class", 0
}
template "class" {//document "{@name}Base.h" {
| //
| // «@name».h
| // pEpObjCAdapter
| //
| // Created by Dirk Zimmermann on 10.11.17.
| // Copyright © 2017 p≡p. All rights reserved.
| //
|
| #import <Foundation/Foundation.h>
|
| #import "PEPSessionProtocol.h"
|
| @interface PEPIdentity : NSObject
|
apply "property"
|
|
| @end
}
template "property" {
choose {
when "@nullability"
| @property (nonatomic, «@nullability») «@type» «@name»;
otherwise
| @property (nonatomic) «@type» «@name»;
}
}
}

Loading…
Cancel
Save