| 126 | } |
| 127 | |
| 128 | String __hxcpp_resource_string(String inName) |
| 129 | { |
| 130 | if (sgResources) |
| 131 | for(Resource *reso = sgResources; reso->mData; reso++) |
| 132 | { |
| 133 | if (reso->mName == inName) |
| 134 | #if (HXCPP_API_LEVEL > 0) |
| 135 | { |
| 136 | #ifdef HX_SMART_STRINGS |
| 137 | const unsigned char *p = reso->mData; |
| 138 | for(int i=0;i<reso->mDataLength;i++) |
| 139 | if (p[i]>127) |
| 140 | return String::create((const char *)p, reso->mDataLength); |
| 141 | #endif |
| 142 | return String((const char *) reso->mData, reso->mDataLength ); |
| 143 | } |
| 144 | #else |
| 145 | return String::create((const char *) reso->mData, reso->mDataLength ); |
| 146 | #endif |
| 147 | } |
| 148 | |
| 149 | if (sgSecondResources) |
| 150 | { |
| 151 | for(Resource *reso = sgSecondResources; reso->mData; reso++) |
| 152 | if (reso->mName == inName) |
| 153 | { |
| 154 | #ifdef HX_SMART_STRINGS |
| 155 | const unsigned char *p = reso->mData; |
| 156 | for(int i=0;i<reso->mDataLength;i++) |
| 157 | if (p[i]>127) |
| 158 | return _hx_utf8_to_utf16(p, reso->mDataLength,false); |
| 159 | #endif |
| 160 | return String((const char *) reso->mData, reso->mDataLength ); |
| 161 | |
| 162 | return String((const char *) reso->mData, reso->mDataLength ); |
| 163 | } |
| 164 | } |
| 165 | return null(); |
| 166 | } |
| 167 | |
| 168 | Array<unsigned char> __hxcpp_resource_bytes(String inName) |
| 169 | { |
nothing calls this directly
no test coverage detected