MCPcopy Create free account
hub / github.com/Qihoo360/poseidon / addSection

Method addSection

builder/index/src/main/java/util/IniParser.java:338–351  ·  view source on GitHub ↗

Adds a section if it doesn't exist yet. @param name the name of the section @return true if the section didn't already exist @throws IllegalArgumentException the name is illegal, ie contains one of the characters '[' and ']' or consists only of white sp

(String name)

Source from the content-addressed store, hash-verified

336 * of the characters '[' and ']' or consists only of white space
337 */
338 public boolean addSection(String name) {
339 String normName = normSection(name);
340 if (!hasSection(normName)) {
341 // Section constructor might throw IllegalArgumentException
342 Section section = new Section(normName, this.commentDelims,
343 this.isCaseSensitive);
344 section.setOptionFormat(this.optionFormat);
345 this.sections.put(normName, section);
346 this.sectionOrder.add(normName);
347 return true;
348 } else {
349 return false;
350 }
351 }
352
353 /**
354 * Removes a section if it exists.

Callers 2

IniParserMethod · 0.95
loadMethod · 0.95

Calls 4

normSectionMethod · 0.95
hasSectionMethod · 0.95
setOptionFormatMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected