Пример #1
0
Value::Members
Value::getMemberNames () const
{
    JSON_ASSERT ( type_ == nullValue  ||  type_ == objectValue );

    if ( type_ == nullValue )
        return Value::Members ();

    Members members;
    members.reserve ( value_.map_->size () );
#ifndef JSON_VALUE_USE_INTERNAL_MAP
    ObjectValues::const_iterator it = value_.map_->begin ();
    ObjectValues::const_iterator itEnd = value_.map_->end ();

    for ( ; it != itEnd; ++it )
        members.push_back ( std::string ( (*it).first.c_str () ) );

#else
    ValueInternalMap::IteratorState it;
    ValueInternalMap::IteratorState itEnd;
    value_.map_->makeBeginIterator ( it );
    value_.map_->makeEndIterator ( itEnd );

    for ( ; !ValueInternalMap::equals ( it, itEnd ); ValueInternalMap::increment (it) )
        members.push_back ( std::string ( ValueInternalMap::key ( it ) ) );

#endif
    return members;
}
Пример #2
0
        int main()
    {
        Members const constObject;
        Members       nonConstObject;

        constObject.member();
        nonConstObject.member();
    }
Пример #3
0
 void add_component(Members const& xs, Graph& g) {
     using namespace boost;
     for (std::size_t i = 0; i < xs.size(); ++i) {
         for (std::size_t j = i + 1; j < xs.size(); ++j) {
             add_edge(xs[i], xs[j], g);
         }
     }
 }
Пример #4
0
void BtcTxTarget::ConvertSatoshisToBitcoin()
{
    Members targetAddresses = this->getMemberNames();
    for (Json::Value::ArrayIndex i = 0; i < targetAddresses.size(); i++)
    {
        (*this)[targetAddresses[i]] = BtcHelper::SatoshisToCoins(
                    (*this)[targetAddresses[i]].asInt64());
    }
}
Пример #5
0
void Configuration::keys(std::vector<std::string>& keys, const std::string& baseKey)
{
	Mutex::ScopedLock lock(_mutex); 
		
    Members members = this->getMemberNames();
	for (unsigned i = 0; i < members.size(); i++) {
		if (members[i].find(baseKey) != std::string::npos)
			keys.push_back(members[i]);
	}
}
Пример #6
0
void RadioButtonGroup::requiredAttributeChanged(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  auto it = m_members.find(button);
  DCHECK_NE(it, m_members.end());
  bool wasValid = isValid();
  // Synchronize the 'required' flag for the button, along with
  // updating the overall count.
  updateRequiredButton(*it, button->isRequired());
  if (wasValid != isValid())
    setNeedsValidityCheckForAllButtons();
}
Пример #7
0
void Configuration::removeAll(const std::string& baseKey)
{
	TraceL << "remove all: " << baseKey << endl;
	Mutex::ScopedLock lock(_mutex); 	
	
    Members members = this->getMemberNames();
	for (unsigned i = 0; i < members.size(); i++) {
		if (members[i].find(baseKey) != std::string::npos)
			removeMember(members[i]);
	}
}
Пример #8
0
Value::Members Value::getMemberNames() const {
  JSON_ASSERT_MESSAGE(
      type() == nullValue || type() == objectValue,
      "in Json::Value::getMemberNames(), value must be objectValue");
  if (type() == nullValue)
    return Value::Members();
  Members members;
  members.reserve(value_.map_->size());
  ObjectValues::const_iterator it = value_.map_->begin();
  ObjectValues::const_iterator itEnd = value_.map_->end();
  for (; it != itEnd; ++it) {
    members.push_back(String((*it).first.data(), (*it).first.length()));
  }
  return members;
}
Пример #9
0
Value::Members
Value::getMemberNames() const
{
   JSON_ASSERT( type_ == nullValue  ||  type_ == objectValue );
   if ( type_ == nullValue )
       return Value::Members();
   Members members;
   members.reserve( value_.map_->size() );

   ObjectValues::const_iterator it = value_.map_->begin();
   ObjectValues::const_iterator itEnd = value_.map_->end();
   for ( ; it != itEnd; ++it )
      members.push_back( std::string( (*it).first.c_str() ) );


   return members;
}
Пример #10
0
   std::string Class::GetBaseClassName(std::string ClassName, std::string MemberName)
   {
      Members oMembers;

      if (Class::GetMembers(ClassName, oMembers))
      {
         std::list< std::pair<std::string, Access::Variable> >::iterator it;
         it = _FindVariable(oMembers.GetVariableMap(), MemberName);

         if (it != oMembers.GetVariableMap().end())
         {
            Variable V = (*it).second;
            return (*it).second.sClassname;
         }
      }

      return std::string();
   }
Пример #11
0
void RadioButtonGroup::remove(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  auto it = m_members.find(button);
  if (it == m_members.end())
    return;
  bool wasValid = isValid();
  DCHECK_EQ(it->value, button->isRequired());
  updateRequiredButton(*it, false);
  m_members.remove(it);
  if (m_checkedButton == button)
    m_checkedButton = nullptr;

  if (m_members.isEmpty()) {
    DCHECK(!m_requiredCount);
    DCHECK(!m_checkedButton);
  } else if (wasValid != isValid()) {
    setNeedsValidityCheckForAllButtons();
  }
  if (!wasValid) {
    // A radio button not in a group is always valid. We need to make it
    // valid only if the group was invalid.
    button->setNeedsValidityCheck();
  }

  // Send notification to update AX attributes for AXObjects which radiobutton
  // group has.
  if (!m_members.isEmpty()) {
    HTMLInputElement* input = m_members.begin()->key;
    if (AXObjectCache* cache = input->document().existingAXObjectCache())
      cache->radiobuttonRemovedFromGroup(input);
  }
}
Пример #12
0
int main() {
#if 0
	SipProtocol protocol;
	protocol.buildRequestHeader("[email protected]", //user
								"192.168.80.111",	//from
								"192.168.80.125",	//to
								"192.168.80.125",	//via
								"1"	,				//cseq
								"qega444afa4g6aga4g"//call-id
								);
	waitForCall(&protocol);
	protocol.dumpProperties();
#endif
	DisableCompare<CppString> discom;
	Members val;

	val.insert(pair<CppString, int>("key1", 1));
	val.insert(pair<CppString, int>("key2", 2));

	Members::iterator iter;
	for(iter = val.begin(); iter != val.end(); iter++) {
		cout << iter->first << endl;
	}
}
Пример #13
0
void RadioButtonGroup::updateCheckedState(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  DCHECK(m_members.contains(button));
  bool wasValid = isValid();
  if (button->checked()) {
    setCheckedButton(button);
  } else {
    if (m_checkedButton == button)
      m_checkedButton = nullptr;
  }
  if (wasValid != isValid())
    setNeedsValidityCheckForAllButtons();
  for (auto& member : m_members) {
    HTMLInputElement* const inputElement = member.key;
    inputElement->pseudoStateChanged(CSSSelector::PseudoIndeterminate);
  }
}
Пример #14
0
void RadioButtonGroup::add(HTMLInputElement* button) {
  DCHECK_EQ(button->type(), InputTypeNames::radio);
  auto addResult = m_members.add(button, false);
  if (!addResult.isNewEntry)
    return;
  bool groupWasValid = isValid();
  updateRequiredButton(*addResult.storedValue, button->isRequired());
  if (button->checked())
    setCheckedButton(button);

  bool groupIsValid = isValid();
  if (groupWasValid != groupIsValid) {
    setNeedsValidityCheckForAllButtons();
  } else if (!groupIsValid) {
    // A radio button not in a group is always valid. We need to make it
    // invalid only if the group is invalid.
    button->setNeedsValidityCheck();
  }
}
Пример #15
0
unsigned RadioButtonGroup::size() const {
  return m_members.size();
}
Пример #16
0
bool RadioButtonGroup::contains(HTMLInputElement* button) const {
  return m_members.contains(button);
}