Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /** | 1 /** |
|
Emily Fortuna
2013/06/12 21:10:56
please add copyright notice at the top of this fil
Tate Mandel
2013/06/12 21:18:41
Done.
| |
| 2 * This library is used to convert data from a map to a YAML string. | 2 * This library is used to convert data from a map to a YAML string. |
| 3 */ | 3 */ |
| 4 library dart2yaml; | 4 library dart2yaml; |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * Gets a String representing the input Map in YAML format. | 7 * Gets a String representing the input Map in YAML format. |
| 8 */ | 8 */ |
| 9 String getYamlString(Map documentData) { | 9 String getYamlString(Map documentData) { |
| 10 StringBuffer yaml = new StringBuffer(); | 10 StringBuffer yaml = new StringBuffer(); |
| 11 _addLevel(yaml, documentData, 0); | 11 _addLevel(yaml, documentData, 0); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 53 | 53 |
| 54 /** | 54 /** |
| 55 * Based on the depth in the file, this function returns the correct spacing | 55 * Based on the depth in the file, this function returns the correct spacing |
| 56 * for an element in the YAML output. | 56 * for an element in the YAML output. |
| 57 */ | 57 */ |
| 58 void _calcSpaces(int spaceLevel, StringBuffer yaml) { | 58 void _calcSpaces(int spaceLevel, StringBuffer yaml) { |
| 59 for (int i = 0; i < spaceLevel; i++) { | 59 for (int i = 0; i < spaceLevel; i++) { |
| 60 yaml.write(" "); | 60 yaml.write(" "); |
| 61 } | 61 } |
| 62 } | 62 } |
| OLD | NEW |