OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2006 The Android Open Source Project | 3 * Copyright 2006 The Android Open Source Project |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 #include "SkXMLWriter.h" | 10 #include "SkXMLWriter.h" |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 void SkXMLStreamWriter::UnitTest() | 302 void SkXMLStreamWriter::UnitTest() |
303 { | 303 { |
304 #ifdef SK_SUPPORT_UNITTEST | 304 #ifdef SK_SUPPORT_UNITTEST |
305 SkDebugWStream s; | 305 SkDebugWStream s; |
306 SkXMLStreamWriter w(&s); | 306 SkXMLStreamWriter w(&s); |
307 | 307 |
308 w.startElement("elem0"); | 308 w.startElement("elem0"); |
309 w.addAttribute("hello", "world"); | 309 w.addAttribute("hello", "world"); |
310 w.addS32Attribute("dec", 42); | 310 w.addS32Attribute("dec", 42); |
311 w.addHexAttribute("hex", 0x42, 3); | 311 w.addHexAttribute("hex", 0x42, 3); |
312 #ifdef SK_SCALAR_IS_FLOAT | |
313 w.addScalarAttribute("scalar", -4.2f); | 312 w.addScalarAttribute("scalar", -4.2f); |
314 #endif | |
315 w.startElement("elem1"); | 313 w.startElement("elem1"); |
316 w.endElement(); | 314 w.endElement(); |
317 w.startElement("elem1"); | 315 w.startElement("elem1"); |
318 w.addAttribute("name", "value"); | 316 w.addAttribute("name", "value"); |
319 w.endElement(); | 317 w.endElement(); |
320 w.startElement("elem1"); | 318 w.startElement("elem1"); |
321 w.startElement("elem2"); | 319 w.startElement("elem2"); |
322 w.startElement("elem3"); | 320 w.startElement("elem3"); |
323 w.addAttribute("name", "value"); | 321 w.addAttribute("name", "value"); |
324 w.endElement(); | 322 w.endElement(); |
325 w.endElement(); | 323 w.endElement(); |
326 w.startElement("elem2"); | 324 w.startElement("elem2"); |
327 w.endElement(); | 325 w.endElement(); |
328 w.endElement(); | 326 w.endElement(); |
329 w.endElement(); | 327 w.endElement(); |
330 #endif | 328 #endif |
331 } | 329 } |
332 | 330 |
333 #endif | 331 #endif |
OLD | NEW |