| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 1 /** | 5 /** |
| 2 * This library is used to convert data from a map to a YAML string. | 6 * This library is used to convert data from a map to a YAML string. |
| 3 */ | 7 */ |
| 4 library dart2yaml; | 8 library dart2yaml; |
| 5 | 9 |
| 6 /** | 10 /** |
| 7 * Gets a String representing the input Map in YAML format. | 11 * Gets a String representing the input Map in YAML format. |
| 8 */ | 12 */ |
| 9 String getYamlString(Map documentData) { | 13 String getYamlString(Map documentData) { |
| 10 StringBuffer yaml = new StringBuffer(); | 14 StringBuffer yaml = new StringBuffer(); |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 | 57 |
| 54 /** | 58 /** |
| 55 * Based on the depth in the file, this function returns the correct spacing | 59 * Based on the depth in the file, this function returns the correct spacing |
| 56 * for an element in the YAML output. | 60 * for an element in the YAML output. |
| 57 */ | 61 */ |
| 58 void _calcSpaces(int spaceLevel, StringBuffer yaml) { | 62 void _calcSpaces(int spaceLevel, StringBuffer yaml) { |
| 59 for (int i = 0; i < spaceLevel; i++) { | 63 for (int i = 0; i < spaceLevel; i++) { |
| 60 yaml.write(" "); | 64 yaml.write(" "); |
| 61 } | 65 } |
| 62 } | 66 } |
| OLD | NEW |