MCPcopy Create free account
hub / github.com/cuberite/cuberite / makePath

Method makePath

lib/jsoncpp/src/lib_json/json_value.cpp:1567–1608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1565
1566
1567void
1568Path::makePath( const std::string &path,
1569 const InArgs &in )
1570{
1571 const char *current = path.c_str();
1572 const char *end = current + path.length();
1573 InArgs::const_iterator itInArg = in.begin();
1574 while ( current != end )
1575 {
1576 if ( *current == '[' )
1577 {
1578 ++current;
1579 if ( *current == '%' )
1580 addPathInArg( path, in, itInArg, PathArgument::kindIndex );
1581 else
1582 {
1583 Value::UInt index = 0;
1584 for ( ; current != end && *current >= '0' && *current <= '9'; ++current )
1585 index = index * 10 + Value::UInt(*current - '0');
1586 args_.push_back( index );
1587 }
1588 if ( current == end || *current++ != ']' )
1589 invalidPath( path, int(current - path.c_str()) );
1590 }
1591 else if ( *current == '%' )
1592 {
1593 addPathInArg( path, in, itInArg, PathArgument::kindKey );
1594 ++current;
1595 }
1596 else if ( *current == '.' )
1597 {
1598 ++current;
1599 }
1600 else
1601 {
1602 const char *beginName = current;
1603 while ( current != end && !strchr( "[.", *current ) )
1604 ++current;
1605 args_.push_back( std::string( beginName, current ) );
1606 }
1607 }
1608}
1609
1610
1611void

Callers

nothing calls this directly

Calls 3

stringClass · 0.85
c_strMethod · 0.80
beginMethod · 0.80

Tested by

no test coverage detected