// AddSection adds a new section to the configuration.
//
// If the section is nil then uses the section by default which it's already
// created.
//
// It returns true if the new section was inserted, and false if the section
// already existed.
342025
func (self *Config) AddSection(section string) bool {
	// _DEFAULT_SECTION
	if section == "" {
		return false
	}

	if _, ok := self.data[section]; ok {
		return false
	}

	self.data[section] = make(map[string]*tValue)

	// Section order
	self.idSection[section] = self.lastIdSection
	self.lastIdSection++

	return true
}
1304295
func (s *Subsection) AddOption(key string, value string) *Subsection {
	s.Options = s.Options.withAddedOption(key, value)
	return s
}
278422
func (self *Config) Sections() (sections []string) {
	sections = make([]string, len(self.idSection))
	pos := 0 // Position in sections

	for i := 0; i < self.lastIdSection; i++ {
		for section, id := range self.idSection {
			if id == i {
				sections[pos] = section
				pos++
			}
		}
	}

	return sections
}
128295
public void addSection(String pstrSection, String pstrComments)
    {
        INISection objSec   = null;

        objSec = (INISection) this.mhmapSections.get(pstrSection);
        if (objSec == null)
        {
            objSec = new INISection(pstrSection);
            this.mhmapSections.put(pstrSection, objSec);
        }
        objSec.setSecComments(delRemChars(pstrComments));
        objSec = null;
    }
324025
func (t Sections) GetSection(p string) (Section, bool) {
	v, ok := t.container[p]
	return v, ok
}
110311
func (r *RegionSet) Add(r2 Region) {
	r.lock.Lock()
	defer r.lock.Unlock()

	ov := r.overlaps(r2, 0, len(r.regions))
	r.regions = append(r.regions, r2)
	if len(ov) == 0 {
		return
	}
	ref := ov[0]
	ov = append(ov[1:], len(r.regions)-1)
	r.merge(ref, ov)
}
909084
func (p *parser) parseSection(inverse bool) (node, error) {
	t := p.read()
	if t.typ != tokenIdentifier {
		return nil, p.errorf(t, "unexpected token %s", t)
	}
	if next := p.read(); next.typ != tokenRightDelim {
		return nil, p.errorf(t, "unexpected token %s", t)
	}
	var (
		tokens []token
		stack  = 1
	)
	for {
		read, err := p.readv(t)
		if err != nil {
			return nil, err
		}
		tokens = append(tokens, read...)
		if len(read) > 1 {
			// Check the token that preceeded the matching identifier. For
			// section start and inverse tokens we increase the stack, otherwise
			// decrease.
			tt := read[len(read)-2]
			switch {
			case tt.typ == tokenSectionStart || tt.typ == tokenSectionInverse:
				stack++
			case tt.typ == tokenSectionEnd:
				stack--
			}
		}
		if stack == 0 {
			break
		}
	}
	nodes, err := subParser(tokens[:len(tokens)-3]).parse()
	if err != nil {
		return nil, err
	}
	section := &sectionNode{
		name:     t.val,
		inverted: inverse,
		elems:    nodes,
	}
	return section, nil
}
905891
private boolean addConfig(String section, String option, String value) {
        if (section.equals("")) {
            section = DEFAULT_SECTION;
        }

        if (!data.containsKey(section)) {
            data.put(section, new HashMap<>());
        }

        boolean ok = data.get(section).containsKey(option);
        data.get(section).put(option, value);
        return !ok;
    }
953444
public void addSection(String section, Composite composite)
    {
        sections.put(section,composite);
        add(composite);
    }
391746
func (section *Section) AddInclude(filename string) {
	section.includes = append(section.includes, filename)
}
696910
func (s *RegionService) AddRegion(p *AddRegionParams) (*AddRegionResponse, error) {
	resp, err := s.cs.newRequest("addRegion", p.toURLValues())
	if err != nil {
		return nil, err
	}

	var r AddRegionResponse
	if err := json.Unmarshal(resp, &r); err != nil {
		return nil, err
	}

	return &r, nil
}
670026
def add_option(self, section, option, value=None):
        
        # check if section exists; create if not
        if not self.config.has_section(section):
            message = self.add_section(section)
            if not message[0]:
                return message

        if not self.config.has_option(section, option):
            if value:
                self.config.set(section, option, value)
            else:
                self.config.set(section, option)
            return(True, self.config.options(section))
        return(False, 'Option: {} already exists @ {}'.format(option, section))
988612
func (f *File) Section(name string) *Section {
	sec, err := f.GetSection(name)
	if err != nil {
		// Note: It's OK here because the only possible error is empty section name,
		// but if it's empty, this piece of code won't be executed.
		sec, _ = f.NewSection(name)
		return sec
	}
	return sec
}
1343845
public function addSections($sections)
    {
        if (current($sections) instanceof Section) {
            foreach ($sections as $section) {
                $this->addSection($section);
            }
        } else {
            foreach ($sections as $key => $value) {
                $this->addSection($key, $value);
            }
        }
    }
101405
public function addSection( $section )
	{
		if ( !( isset( $this->data[$section] ) && is_array( $this->data[$section] ) ) )
			$this->data[$section]	= array();
		$this->currentSection	= $section;
	}
512810
func (section *Section) Merge(source *Section) error {
	for _, key := range source.Keys() {
		sourceValue, _ := source.Get(key)
		targetValue, err := section.Get(key)

		// not found, so add it
		if err != nil {
			section.Set(key, sourceValue)
			continue
		}

		// found existing one and it's type SECTION, merge it
		if targetValue.GetType() == SECTION {
			// Source value have to be SECTION type here
			if sourceValue.GetType() != SECTION {
				return fmt.Errorf("source (%v) and target (%v) type doesn't match: %v",
					sourceValue.GetType(),
					targetValue.GetType(),
					key)
			}

			if err = targetValue.(*Section).Merge(sourceValue.(*Section)); err != nil {
				return err
			}

			continue
		}

		// found existing one, update it
		if err = targetValue.UpdateValue(sourceValue.GetValue()); err != nil {
			return fmt.Errorf("%v: %v", err, key)
		}
	}
	return nil
}
356958
func (f File) Section(name string) Section {
	section := f[name]
	if section == nil {
		section = make(Section)
		f[name] = section
	}
	return section
}