TemplateInfo 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (226) hide show
  1. data/.DS_Store +0 -0
  2. data/.gitignore +2 -0
  3. data/TemplateInfo.gemspec +1 -1
  4. data/bin/tif_create.rb +157 -0
  5. data/lib/TemplateInfo/version.rb +1 -1
  6. data/test.xctemplate/.DS_Store +0 -0
  7. data/test.xctemplate/TemplateInfo.plist +2830 -0
  8. data/test.xctemplate/TemplateInfo.xml +2842 -0
  9. data/test.xctemplate/libs/BeeFramework/Bee.h +35 -0
  10. data/test.xctemplate/libs/BeeFramework/Bee_Precompile.h +143 -0
  11. data/test.xctemplate/libs/BeeFramework/Core/Bee_Core.h +36 -0
  12. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Foundation.h +54 -0
  13. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Foundation.mm +33 -0
  14. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Log.h +64 -0
  15. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Log.mm +164 -0
  16. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Performance.h +111 -0
  17. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Performance.mm +122 -0
  18. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Runtime.h +98 -0
  19. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Runtime.mm +437 -0
  20. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Sandbox.h +45 -0
  21. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Sandbox.mm +81 -0
  22. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Singleton.h +47 -0
  23. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Singleton.mm +34 -0
  24. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_SystemInfo.h +62 -0
  25. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_SystemInfo.m +147 -0
  26. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Thread.h +64 -0
  27. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Bee_Thread.mm +91 -0
  28. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSArray+BeeExtension.h +76 -0
  29. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSArray+BeeExtension.m +300 -0
  30. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSData+BeeExtension.h +44 -0
  31. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSData+BeeExtension.m +92 -0
  32. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDate+BeeExtension.h +44 -0
  33. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDate+BeeExtension.m +85 -0
  34. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDictionary+BeeExtension.h +90 -0
  35. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSDictionary+BeeExtension.m +509 -0
  36. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSNumber+BeeExtension.h +50 -0
  37. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSNumber+BeeExtension.m +64 -0
  38. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeJSON.h +43 -0
  39. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeJSON.m +116 -0
  40. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeNotification.h +66 -0
  41. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeNotification.m +150 -0
  42. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeProperty.h +210 -0
  43. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeProperty.m +34 -0
  44. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTicker.h +41 -0
  45. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTicker.m +156 -0
  46. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTypeConversion.h +49 -0
  47. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSObject+BeeTypeConversion.m +109 -0
  48. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSString+BeeExtension.h +86 -0
  49. data/test.xctemplate/libs/BeeFramework/Core/Foundation/Extension/NSString+BeeExtension.m +464 -0
  50. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Network.h +36 -0
  51. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Network.m +33 -0
  52. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Request.h +144 -0
  53. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_Request.m +560 -0
  54. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_RequestQueue.h +99 -0
  55. data/test.xctemplate/libs/BeeFramework/Core/Network/Bee_RequestQueue.m +742 -0
  56. data/test.xctemplate/libs/BeeFramework/Core/Network/Extension/NSObject+BeeRequest.h +62 -0
  57. data/test.xctemplate/libs/BeeFramework/Core/Network/Extension/NSObject+BeeRequest.m +175 -0
  58. data/test.xctemplate/libs/BeeFramework/Core/Storage/0.2.4.zip +0 -0
  59. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveBase.h +133 -0
  60. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveBase.m +641 -0
  61. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveRecord.h +106 -0
  62. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_ActiveRecord.m +1956 -0
  63. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Cache.h +91 -0
  64. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Cache.m +318 -0
  65. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Database.h +223 -0
  66. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Database.m +3007 -0
  67. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Keychain.h +55 -0
  68. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Keychain.m +173 -0
  69. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Storage.h +39 -0
  70. data/test.xctemplate/libs/BeeFramework/Core/Storage/Bee_Storage.m +33 -0
  71. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeDatabase.h +47 -0
  72. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeDatabase.m +81 -0
  73. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeKeychain.h +44 -0
  74. data/test.xctemplate/libs/BeeFramework/Core/Storage/Extension/NSObject+BeeKeychain.m +57 -0
  75. data/test.xctemplate/libs/BeeFramework/MVC/Bee_MVC.h +49 -0
  76. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Controller.h +66 -0
  77. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Controller.mm +228 -0
  78. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Message.h +209 -0
  79. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_Message.mm +873 -0
  80. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_MessageQueue.h +75 -0
  81. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Bee_MessageQueue.mm +389 -0
  82. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+ActiveRecord.h +52 -0
  83. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+ActiveRecord.m +150 -0
  84. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+HTTP.h +49 -0
  85. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+HTTP.mm +201 -0
  86. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+JSON.h +52 -0
  87. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+JSON.mm +118 -0
  88. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+XML.h +49 -0
  89. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/BeeMessage+XML.mm +78 -0
  90. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/NSObject+BeeMessage.h +57 -0
  91. data/test.xctemplate/libs/BeeFramework/MVC/Controller/Extension/NSObject+BeeMessage.mm +138 -0
  92. data/test.xctemplate/libs/BeeFramework/MVC/Model/Bee_Model.h +64 -0
  93. data/test.xctemplate/libs/BeeFramework/MVC/Model/Bee_Model.m +190 -0
  94. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActionSheet.h +71 -0
  95. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActionSheet.m +307 -0
  96. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActivityIndicatorView.h +52 -0
  97. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIActivityIndicatorView.m +152 -0
  98. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIAlertView.h +73 -0
  99. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIAlertView.m +234 -0
  100. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIButton.h +97 -0
  101. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIButton.m +424 -0
  102. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIDatePicker.h +78 -0
  103. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIDatePicker.m +362 -0
  104. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIGridCell.h +82 -0
  105. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIGridCell.m +298 -0
  106. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIImageView.h +110 -0
  107. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIImageView.m +541 -0
  108. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIKeyboard.h +74 -0
  109. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIKeyboard.m +243 -0
  110. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UILabel.h +46 -0
  111. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UILabel.m +99 -0
  112. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIMatrixView.h +124 -0
  113. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIMatrixView.m +821 -0
  114. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UINavigationBar.h +57 -0
  115. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UINavigationBar.m +161 -0
  116. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIOrientation.h +60 -0
  117. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIOrientation.m +146 -0
  118. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPageControl.h +61 -0
  119. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPageControl.m +190 -0
  120. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIProgressView.h +47 -0
  121. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIProgressView.m +113 -0
  122. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPullLoader.h +71 -0
  123. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIPullLoader.m +236 -0
  124. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIScrollView.h +146 -0
  125. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIScrollView.m +1487 -0
  126. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISegmentedControl.h +60 -0
  127. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISegmentedControl.m +192 -0
  128. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISignal.h +126 -0
  129. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UISignal.m +453 -0
  130. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITabBar.h +70 -0
  131. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITabBar.m +249 -0
  132. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextField.h +67 -0
  133. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextField.m +242 -0
  134. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextView.h +75 -0
  135. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITextView.m +311 -0
  136. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITipsView.h +184 -0
  137. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UITipsView.m +911 -0
  138. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIWebView.h +65 -0
  139. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIWebView.m +242 -0
  140. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIZoomView.h +91 -0
  141. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_UIZoomView.m +444 -0
  142. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_View.h +72 -0
  143. data/test.xctemplate/libs/BeeFramework/MVC/View/Bee_View.m +38 -0
  144. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.h +79 -0
  145. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.m +288 -0
  146. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.h +65 -0
  147. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.m +161 -0
  148. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.h +45 -0
  149. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.m +137 -0
  150. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.h +56 -0
  151. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.m +218 -0
  152. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.h +105 -0
  153. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.m +556 -0
  154. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.h +53 -0
  155. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.m +104 -0
  156. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.h +52 -0
  157. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.m +170 -0
  158. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.h +54 -0
  159. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.m +166 -0
  160. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.h +54 -0
  161. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.m +184 -0
  162. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.h +57 -0
  163. data/test.xctemplate/libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.m +275 -0
  164. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIBoard.h +212 -0
  165. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIBoard.m +1219 -0
  166. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStack.h +111 -0
  167. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStack.m +694 -0
  168. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStackGroup.h +71 -0
  169. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_UIStackGroup.m +258 -0
  170. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_ViewController.h +45 -0
  171. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Bee_ViewController.m +36 -0
  172. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeExtension.h +57 -0
  173. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeExtension.m +151 -0
  174. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.h +53 -0
  175. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+BeeUISignal.m +92 -0
  176. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+UINavigationBar.h +72 -0
  177. data/test.xctemplate/libs/BeeFramework/MVC/ViewController/Extension/UIViewController+UINavigationBar.m +175 -0
  178. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UICollection.h +59 -0
  179. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UICollection.m +249 -0
  180. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UILayout.h +199 -0
  181. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UILayout.m +1170 -0
  182. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIQuery.h +113 -0
  183. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIQuery.m +710 -0
  184. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIStyle.h +66 -0
  185. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UIStyle.m +189 -0
  186. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplate.h +69 -0
  187. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplate.m +210 -0
  188. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateAndroid.h +45 -0
  189. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateAndroid.m +59 -0
  190. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateHTML.h +45 -0
  191. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateHTML.m +55 -0
  192. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateJSON.h +45 -0
  193. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateJSON.m +54 -0
  194. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateOmniGraffle.h +45 -0
  195. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateOmniGraffle.m +54 -0
  196. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateXML.h +45 -0
  197. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_UITemplateXML.m +438 -0
  198. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_ViewLayout.h +60 -0
  199. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Bee_ViewLayout.m +37 -0
  200. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIQuery+BeeUIStyle.h +45 -0
  201. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIQuery+BeeUIStyle.m +55 -0
  202. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIStyle+BeeUIQuery.h +45 -0
  203. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/BeeUIStyle+BeeUIQuery.m +55 -0
  204. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIButton+BeeUIStyle.h +41 -0
  205. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIButton+BeeUIStyle.m +100 -0
  206. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIImageView+BeeUIStyle.h +41 -0
  207. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIImageView+BeeUIStyle.m +101 -0
  208. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UILabel+BeeUIStyle.h +41 -0
  209. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UILabel+BeeUIStyle.m +48 -0
  210. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextField+BeeUIStyle.h +41 -0
  211. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextField+BeeUIStyle.m +77 -0
  212. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextView+BeeUIStyle.h +41 -0
  213. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UITextView+BeeUIStyle.m +47 -0
  214. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUILayout.h +52 -0
  215. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUILayout.m +177 -0
  216. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIQuery.h +44 -0
  217. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIQuery.m +57 -0
  218. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIStyle.h +50 -0
  219. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIView+BeeUIStyle.m +283 -0
  220. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUILayout.h +52 -0
  221. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUILayout.m +178 -0
  222. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIQuery.h +44 -0
  223. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIQuery.m +58 -0
  224. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIStyle.h +44 -0
  225. data/test.xctemplate/libs/BeeFramework/MVC/ViewLayout/Extension/UIViewController+BeeUIStyle.m +57 -0
  226. metadata +226 -3
@@ -0,0 +1,122 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // Bee_Performance.h
31
+ //
32
+
33
+ #import "Bee_Precompile.h"
34
+ #import "Bee_Performance.h"
35
+ #include <objc/runtime.h>
36
+
37
+ #pragma mark -
38
+
39
+ @implementation BeePerformance
40
+
41
+ DEF_SINGLETON( BeePerformance );
42
+
43
+ @synthesize records = _records;
44
+ @synthesize tags = _tags;
45
+
46
+ - (id)init
47
+ {
48
+ self = [super init];
49
+ if ( self )
50
+ {
51
+ _records = [[NSMutableDictionary alloc] init];
52
+ _tags = [[NSMutableDictionary alloc] init];
53
+ }
54
+ return self;
55
+ }
56
+
57
+ - (void)dealloc
58
+ {
59
+ [_tags removeAllObjects];
60
+ [_tags release];
61
+
62
+ [_records removeAllObjects];
63
+ [_records release];
64
+
65
+ [super dealloc];
66
+ }
67
+
68
+ + (double)timestamp
69
+ {
70
+ return CACurrentMediaTime();
71
+ }
72
+
73
+ + (double)markTag:(NSString *)tag
74
+ {
75
+ double curr = CACurrentMediaTime();
76
+
77
+ NSNumber * time = [NSNumber numberWithDouble:curr];
78
+ [[BeePerformance sharedInstance].tags setObject:time forKey:tag];
79
+
80
+ return curr;
81
+ }
82
+
83
+ + (double)betweenTag:(NSString *)tag1 andTag:(NSString *)tag2
84
+ {
85
+ return [self betweenTag:tag1 andTag:tag2 shouldRemove:YES];
86
+ }
87
+
88
+ + (double)betweenTag:(NSString *)tag1 andTag:(NSString *)tag2 shouldRemove:(BOOL)remove
89
+ {
90
+ NSNumber * time1 = [[BeePerformance sharedInstance].tags objectForKey:tag1];
91
+ NSNumber * time2 = [[BeePerformance sharedInstance].tags objectForKey:tag2];
92
+
93
+ if ( nil == time1 || nil == time2 )
94
+ return 0.0;
95
+
96
+ double time = fabs( [time2 doubleValue] - [time1 doubleValue] );
97
+
98
+ if ( remove )
99
+ {
100
+ [[BeePerformance sharedInstance].tags removeObjectForKey:tag1];
101
+ [[BeePerformance sharedInstance].tags removeObjectForKey:tag2];
102
+ }
103
+
104
+ return time;
105
+ }
106
+
107
+ + (void)watchClass:(Class)clazz
108
+ {
109
+ [self watchClass:clazz andSelector:nil];
110
+ }
111
+
112
+ + (void)watchClass:(Class)clazz andSelector:(SEL)selector
113
+ {
114
+ // TODO:
115
+ }
116
+
117
+ + (void)recordName:(NSString *)name andTime:(NSTimeInterval)time
118
+ {
119
+ BeeLog( [NSString stringWithFormat:@"[PERF] '%@' = %.4f(s)", name, time] );
120
+ }
121
+
122
+ @end
@@ -0,0 +1,98 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // Bee_Runtime.h
31
+ //
32
+
33
+ #import "Bee_Precompile.h"
34
+ #import "NSObject+BeeProperty.h"
35
+
36
+ #pragma mark -
37
+
38
+ #undef PRINT_CALLSTACK
39
+ #define PRINT_CALLSTACK( __n ) [BeeRuntime printCallstack:__n]
40
+
41
+ #pragma mark -
42
+
43
+ @interface BeeCallFrame : NSObject
44
+ {
45
+ NSUInteger _type;
46
+ NSString * _process;
47
+ NSUInteger _entry;
48
+ NSUInteger _offset;
49
+ NSString * _clazz;
50
+ NSString * _method;
51
+ }
52
+
53
+ AS_INT( TYPE_UNKNOWN )
54
+ AS_INT( TYPE_OBJC )
55
+ AS_INT( TYPE_NATIVEC )
56
+
57
+ @property (nonatomic, assign) NSUInteger type;
58
+ @property (nonatomic, retain) NSString * process;
59
+ @property (nonatomic, assign) NSUInteger entry;
60
+ @property (nonatomic, assign) NSUInteger offset;
61
+ @property (nonatomic, retain) NSString * clazz;
62
+ @property (nonatomic, retain) NSString * method;
63
+
64
+ + (id)parse:(NSString *)line;
65
+ + (id)unknown;
66
+
67
+ @end
68
+
69
+ #pragma mark -
70
+
71
+ @interface BeeTypeEncoding : NSObject
72
+
73
+ AS_INT( UNKNOWN )
74
+ AS_INT( OBJECT )
75
+ AS_INT( NSNUMBER )
76
+ AS_INT( NSSTRING )
77
+ AS_INT( NSARRAY )
78
+ AS_INT( NSDICTIONARY )
79
+ AS_INT( NSDATE )
80
+
81
+ + (NSUInteger)typeOf:(const char *)attr;
82
+ + (NSString *)classNameOf:(const char *)attr;
83
+
84
+ @end
85
+
86
+ #pragma mark -
87
+
88
+ @interface BeeRuntime : NSObject
89
+
90
+ + (id)allocByClass:(Class)clazz;
91
+ + (id)allocByClassName:(NSString *)clazzName;
92
+
93
+ + (NSArray *)callstack:(NSUInteger)depth;
94
+ + (NSArray *)callframes:(NSUInteger)depth;
95
+
96
+ + (void)printCallstack:(NSUInteger)depth;
97
+
98
+ @end
@@ -0,0 +1,437 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // Bee_UtilityRuntime.h
31
+ //
32
+
33
+ #import "Bee_Precompile.h"
34
+
35
+ #include <stdio.h>
36
+ #include <stdlib.h>
37
+ #include <stdint.h>
38
+ #include <string.h>
39
+ #include <assert.h>
40
+ #include <sys/errno.h>
41
+ #include <math.h>
42
+ #include <limits.h>
43
+ #include <objc/runtime.h>
44
+ #include <execinfo.h>
45
+
46
+ #import "Bee_Runtime.h"
47
+ #import "Bee_Log.h"
48
+
49
+ #define MAX_CALLSTACK_DEPTH (64)
50
+
51
+ #pragma mark -
52
+
53
+ @interface BeeCallFrame(Private)
54
+ + (NSUInteger)hex:(NSString *)text;
55
+ + (id)parseFormat1:(NSString *)line;
56
+ + (id)parseFormat2:(NSString *)line;
57
+ @end
58
+
59
+ #pragma mark -
60
+
61
+ @implementation BeeCallFrame
62
+
63
+ DEF_INT( TYPE_UNKNOWN, 0 )
64
+ DEF_INT( TYPE_OBJC, 1 )
65
+ DEF_INT( TYPE_NATIVEC, 2 )
66
+
67
+ @synthesize type = _type;
68
+ @synthesize process = _process;
69
+ @synthesize entry = _entry;
70
+ @synthesize offset = _offset;
71
+ @synthesize clazz = _clazz;
72
+ @synthesize method = _method;
73
+
74
+ - (NSString *)description
75
+ {
76
+ if ( BeeCallFrame.TYPE_OBJC == _type )
77
+ {
78
+ return [NSString stringWithFormat:@"[O] %@(0x%08x + %d) -> [%@ %@]", _process, (unsigned int)_entry, _offset, _clazz, _method];
79
+ }
80
+ else if ( BeeCallFrame.TYPE_NATIVEC == _type )
81
+ {
82
+ return [NSString stringWithFormat:@"[C] %@(0x%08x + %d) -> %@", _process, (unsigned int)_entry, _offset, _method];
83
+ }
84
+ else
85
+ {
86
+ return [NSString stringWithFormat:@"[X] <unknown>(0x%08x + %d)", (unsigned int)_entry, _offset];
87
+ }
88
+ }
89
+
90
+ + (NSUInteger)hex:(NSString *)text
91
+ {
92
+ unsigned int number = 0;
93
+ [[NSScanner scannerWithString:text] scanHexInt:&number];
94
+ return (NSUInteger)number;
95
+ }
96
+
97
+ + (id)parseFormat1:(NSString *)line
98
+ {
99
+ // example: peeper 0x00001eca -[PPAppDelegate application:didFinishLaunchingWithOptions:] + 106
100
+ NSError * error = NULL;
101
+ NSString * expr = @"^[0-9]*\\s*([a-z0-9_]+)\\s+(0x[0-9a-f]+)\\s+-\\[([a-z0-9_]+)\\s+([a-z0-9_:]+)]\\s+\\+\\s+([0-9]+)$";
102
+ NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:expr options:NSRegularExpressionCaseInsensitive error:&error];
103
+ NSTextCheckingResult * result = [regex firstMatchInString:line options:0 range:NSMakeRange(0, [line length])];
104
+ if ( result && (regex.numberOfCaptureGroups + 1) == result.numberOfRanges )
105
+ {
106
+ BeeCallFrame * frame = [[BeeCallFrame alloc] init];
107
+ frame.type = BeeCallFrame.TYPE_OBJC;
108
+ frame.process = [line substringWithRange:[result rangeAtIndex:1]];
109
+ frame.entry = [BeeCallFrame hex:[line substringWithRange:[result rangeAtIndex:2]]];
110
+ frame.clazz = [line substringWithRange:[result rangeAtIndex:3]];
111
+ frame.method = [line substringWithRange:[result rangeAtIndex:4]];
112
+ frame.offset = [[line substringWithRange:[result rangeAtIndex:5]] intValue];
113
+ return [frame autorelease];
114
+ }
115
+
116
+ return nil;
117
+ }
118
+
119
+ + (id)parseFormat2:(NSString *)line
120
+ {
121
+ // example: UIKit 0x0105f42e UIApplicationMain + 1160
122
+ NSError * error = NULL;
123
+ NSString * expr = @"^[0-9]*\\s*([a-z0-9_]+)\\s+(0x[0-9a-f]+)\\s+([a-z0-9_]+)\\s+\\+\\s+([0-9]+)$";
124
+ NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:expr options:NSRegularExpressionCaseInsensitive error:&error];
125
+ NSTextCheckingResult * result = [regex firstMatchInString:line options:0 range:NSMakeRange(0, [line length])];
126
+ if ( result && (regex.numberOfCaptureGroups + 1) == result.numberOfRanges )
127
+ {
128
+ BeeCallFrame * frame = [[BeeCallFrame alloc] init];
129
+ frame.type = BeeCallFrame.TYPE_NATIVEC;
130
+ frame.process = [line substringWithRange:[result rangeAtIndex:1]];
131
+ frame.entry = [self hex:[line substringWithRange:[result rangeAtIndex:2]]];
132
+ frame.clazz = nil;
133
+ frame.method = [line substringWithRange:[result rangeAtIndex:3]];
134
+ frame.offset = [[line substringWithRange:[result rangeAtIndex:4]] intValue];
135
+ return [frame autorelease];
136
+ }
137
+
138
+ return nil;
139
+ }
140
+
141
+ + (id)unknown
142
+ {
143
+ BeeCallFrame * frame = [[BeeCallFrame alloc] init];
144
+ frame.type = BeeCallFrame.TYPE_UNKNOWN;
145
+ return [frame autorelease];
146
+ }
147
+
148
+ + (id)parse:(NSString *)line
149
+ {
150
+ if ( 0 == [line length] )
151
+ return nil;
152
+
153
+ id frame1 = [BeeCallFrame parseFormat1:line];
154
+ if ( frame1 )
155
+ return frame1;
156
+
157
+ id frame2 = [BeeCallFrame parseFormat2:line];
158
+ if ( frame2 )
159
+ return frame2;
160
+
161
+ return [BeeCallFrame unknown];
162
+ }
163
+
164
+ - (void)dealloc
165
+ {
166
+ [_process release];
167
+ [_clazz release];
168
+ [_method release];
169
+
170
+ [super dealloc];
171
+ }
172
+
173
+ @end
174
+
175
+ #pragma mark -
176
+
177
+ @implementation BeeTypeEncoding
178
+
179
+ DEF_INT( UNKNOWN, 0 )
180
+ DEF_INT( OBJECT, 1 )
181
+ DEF_INT( NSNUMBER, 2 )
182
+ DEF_INT( NSSTRING, 3 )
183
+ DEF_INT( NSARRAY, 4 )
184
+ DEF_INT( NSDICTIONARY, 5 )
185
+ DEF_INT( NSDATE, 6 )
186
+
187
+ + (NSUInteger)typeOf:(const char *)attr
188
+ {
189
+ if ( attr[0] != 'T' )
190
+ return BeeTypeEncoding.UNKNOWN;
191
+
192
+ const char * type = &attr[1];
193
+ if ( type[0] == '@' )
194
+ {
195
+ if ( type[1] != '"' )
196
+ return BeeTypeEncoding.UNKNOWN;
197
+
198
+ char typeClazz[128] = { 0 };
199
+
200
+ const char * clazz = &type[2];
201
+ const char * clazzEnd = strchr( clazz, '"' );
202
+
203
+ if ( clazzEnd && clazz != clazzEnd )
204
+ {
205
+ unsigned int size = (unsigned int)(clazzEnd - clazz);
206
+ strncpy( &typeClazz[0], clazz, size );
207
+ }
208
+
209
+ if ( 0 == strcmp((const char *)typeClazz, "NSNumber") )
210
+ {
211
+ return BeeTypeEncoding.NSNUMBER;
212
+ }
213
+ else if ( 0 == strcmp((const char *)typeClazz, "NSString") )
214
+ {
215
+ return BeeTypeEncoding.NSSTRING;
216
+ }
217
+ else if ( 0 == strcmp((const char *)typeClazz, "NSDate") )
218
+ {
219
+ return BeeTypeEncoding.NSDATE;
220
+ }
221
+ else if ( 0 == strcmp((const char *)typeClazz, "NSArray") )
222
+ {
223
+ return BeeTypeEncoding.NSARRAY;
224
+ }
225
+ else if ( 0 == strcmp((const char *)typeClazz, "NSDictionary") )
226
+ {
227
+ return BeeTypeEncoding.NSDICTIONARY;
228
+ }
229
+ else
230
+ {
231
+ return BeeTypeEncoding.OBJECT;
232
+ }
233
+ }
234
+ else if ( type[0] == '[' )
235
+ {
236
+ return BeeTypeEncoding.UNKNOWN;
237
+ }
238
+ else if ( type[0] == '{' )
239
+ {
240
+ return BeeTypeEncoding.UNKNOWN;
241
+ }
242
+ else
243
+ {
244
+ if ( type[0] == 'c' || type[0] == 'C' )
245
+ {
246
+ return BeeTypeEncoding.UNKNOWN;
247
+ }
248
+ else if ( type[0] == 'i' || type[0] == 's' || type[0] == 'l' || type[0] == 'q' )
249
+ {
250
+ return BeeTypeEncoding.UNKNOWN;
251
+ }
252
+ else if ( type[0] == 'I' || type[0] == 'S' || type[0] == 'L' || type[0] == 'Q' )
253
+ {
254
+ return BeeTypeEncoding.UNKNOWN;
255
+ }
256
+ else if ( type[0] == 'f' )
257
+ {
258
+ return BeeTypeEncoding.UNKNOWN;
259
+ }
260
+ else if ( type[0] == 'd' )
261
+ {
262
+ return BeeTypeEncoding.UNKNOWN;
263
+ }
264
+ else if ( type[0] == 'B' )
265
+ {
266
+ return BeeTypeEncoding.UNKNOWN;
267
+ }
268
+ else if ( type[0] == 'v' )
269
+ {
270
+ return BeeTypeEncoding.UNKNOWN;
271
+ }
272
+ else if ( type[0] == '*' )
273
+ {
274
+ return BeeTypeEncoding.UNKNOWN;
275
+ }
276
+ else if ( type[0] == ':' )
277
+ {
278
+ return BeeTypeEncoding.UNKNOWN;
279
+ }
280
+ else if ( 0 == strcmp(type, "bnum") )
281
+ {
282
+ return BeeTypeEncoding.UNKNOWN;
283
+ }
284
+ else if ( type[0] == '^' )
285
+ {
286
+ return BeeTypeEncoding.UNKNOWN;
287
+ }
288
+ else if ( type[0] == '?' )
289
+ {
290
+ return BeeTypeEncoding.UNKNOWN;
291
+ }
292
+ else
293
+ {
294
+ return BeeTypeEncoding.UNKNOWN;
295
+ }
296
+ }
297
+
298
+ return BeeTypeEncoding.UNKNOWN;
299
+ }
300
+
301
+ + (NSString *)classNameOf:(const char *)attr
302
+ {
303
+ if ( attr[0] != 'T' )
304
+ return nil;
305
+
306
+ const char * type = &attr[1];
307
+ if ( type[0] == '@' )
308
+ {
309
+ if ( type[1] != '"' )
310
+ return nil;
311
+
312
+ char typeClazz[128] = { 0 };
313
+
314
+ const char * clazz = &type[2];
315
+ const char * clazzEnd = strchr( clazz, '"' );
316
+
317
+ if ( clazzEnd && clazz != clazzEnd )
318
+ {
319
+ unsigned int size = (unsigned int)(clazzEnd - clazz);
320
+ strncpy( &typeClazz[0], clazz, size );
321
+ }
322
+
323
+ return [NSString stringWithUTF8String:typeClazz];
324
+ }
325
+
326
+ return nil;
327
+ }
328
+
329
+ @end
330
+
331
+ #pragma mark -
332
+
333
+ @implementation BeeRuntime
334
+
335
+ + (id)allocByClass:(Class)clazz
336
+ {
337
+ if ( nil == clazz )
338
+ return nil;
339
+
340
+ return [clazz alloc];
341
+ }
342
+
343
+ + (id)allocByClassName:(NSString *)clazzName
344
+ {
345
+ if ( nil == clazzName || 0 == [clazzName length] )
346
+ return nil;
347
+
348
+ Class clazz = NSClassFromString( clazzName );
349
+ if ( nil == clazz )
350
+ return nil;
351
+
352
+ return [clazz alloc];
353
+ }
354
+
355
+ + (NSArray *)callstack:(NSUInteger)depth
356
+ {
357
+ NSMutableArray * array = [[NSMutableArray alloc] init];
358
+
359
+ void * stacks[MAX_CALLSTACK_DEPTH] = { 0 };
360
+
361
+ depth = backtrace( stacks, (depth > MAX_CALLSTACK_DEPTH) ? MAX_CALLSTACK_DEPTH : depth );
362
+ if ( depth )
363
+ {
364
+ char ** symbols = backtrace_symbols( stacks, depth );
365
+ if ( symbols )
366
+ {
367
+ for ( int i = 0; i < depth; ++i )
368
+ {
369
+ NSString * symbol = [NSString stringWithUTF8String:(const char *)symbols[i]];
370
+ if ( 0 == [symbol length] )
371
+ continue;
372
+
373
+ NSRange range1 = [symbol rangeOfString:@"["];
374
+ NSRange range2 = [symbol rangeOfString:@"]"];
375
+
376
+ if ( range1.length > 0 && range2.length > 0 )
377
+ {
378
+ NSRange range3;
379
+ range3.location = range1.location;
380
+ range3.length = range2.location + range2.length - range1.location;
381
+ [array addObject:[symbol substringWithRange:range3]];
382
+ }
383
+ else
384
+ {
385
+ [array addObject:symbol];
386
+ }
387
+ }
388
+
389
+ free( symbols );
390
+ }
391
+ }
392
+
393
+ return [array autorelease];
394
+ }
395
+
396
+ + (NSArray *)callframes:(NSUInteger)depth
397
+ {
398
+ NSMutableArray * array = [[NSMutableArray alloc] init];
399
+
400
+ void * stacks[MAX_CALLSTACK_DEPTH] = { 0 };
401
+
402
+ depth = backtrace( stacks, (depth > MAX_CALLSTACK_DEPTH) ? MAX_CALLSTACK_DEPTH : depth );
403
+ if ( depth )
404
+ {
405
+ char ** symbols = backtrace_symbols( stacks, depth );
406
+ if ( symbols )
407
+ {
408
+ for ( int i = 0; i < depth; ++i )
409
+ {
410
+ NSString * line = [NSString stringWithUTF8String:(const char *)symbols[i]];
411
+ if ( 0 == [line length] )
412
+ continue;
413
+
414
+ BeeCallFrame * frame = [BeeCallFrame parse:line];
415
+ if ( nil == frame )
416
+ continue;
417
+
418
+ [array addObject:frame];
419
+ }
420
+
421
+ free( symbols );
422
+ }
423
+ }
424
+
425
+ return [array autorelease];
426
+ }
427
+
428
+ + (void)printCallstack:(NSUInteger)depth
429
+ {
430
+ NSArray * callstack = [self callstack:depth];
431
+ if ( callstack && callstack.count )
432
+ {
433
+ VAR_DUMP( callstack );
434
+ }
435
+ }
436
+
437
+ @end
@@ -0,0 +1,45 @@
1
+ //
2
+ // ______ ______ ______
3
+ // /\ __ \ /\ ___\ /\ ___\
4
+ // \ \ __< \ \ __\_ \ \ __\_
5
+ // \ \_____\ \ \_____\ \ \_____\
6
+ // \/_____/ \/_____/ \/_____/
7
+ //
8
+ // Copyright (c) 2012 BEE creators
9
+ // http://www.whatsbug.com
10
+ //
11
+ // Permission is hereby granted, free of charge, to any person obtaining a
12
+ // copy of this software and associated documentation files (the "Software"),
13
+ // to deal in the Software without restriction, including without limitation
14
+ // the rights to use, copy, modify, merge, publish, distribute, sublicense,
15
+ // and/or sell copies of the Software, and to permit persons to whom the
16
+ // Software is furnished to do so, subject to the following conditions:
17
+ //
18
+ // The above copyright notice and this permission notice shall be included in
19
+ // all copies or substantial portions of the Software.
20
+ //
21
+ // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
+ // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
+ // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
+ // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
+ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26
+ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
27
+ // IN THE SOFTWARE.
28
+ //
29
+ //
30
+ // Bee_UtilitySandbox.h
31
+ //
32
+
33
+ #import "Bee_Precompile.h"
34
+
35
+ @interface BeeSandbox : NSObject
36
+
37
+ + (NSString *)appPath; // 程序目录,不能存任何东西
38
+ + (NSString *)docPath; // 文档目录,需要ITUNES同步备份的数据存这里
39
+ + (NSString *)libPrefPath; // 配置目录,配置文件存这里
40
+ + (NSString *)libCachePath; // 缓存目录,系统永远不会删除这里的文件,ITUNES会删除
41
+ + (NSString *)tmpPath; // 缓存目录,APP退出后,系统可能会删除这里的内容
42
+
43
+ + (BOOL)touch:(NSString *)path;
44
+
45
+ @end