src/lib/url/url_canon_relative.cc
// Copies a single component from the source to the output. This is used
// when resolving relative URLs and a given component is unchanged. Since the
// source should already be canonical, we don't have to do anything special,
// and the input is ASCII.
Copies a single component from the source to the output. This is used
when resolving relative URLs and a given component is unchanged. Since the
source should already be canonical, we don't have to do anything special,
and the input is ASCII.
Copies a single component from the source to the output . This is used when resolving relative URLs and a given component is unchanged . Since the source should already be canonical we don ' t have to do anything special and the input is ASCII .
void CopyOneComponent(const char* source, const Component& source_component, CanonOutput* output,
                      Component* output_component) {
  if (!source_component.is_valid()) {
    *output_component = Component();
    return;
  }
  output_component->begin = output->length();
  int source_end = source_component.end();
  for (int i = source_component.begin; i < source_end; i++)
    output->push_back(source[i]);
  output_component->set_len(output->length() - output_component->begin);
}
void CopyOneComponent ( const char * source , const Component & source_component , CanonOutput * output , Component * output_component ) { if ( ! source_component . is_valid ( ) ) { * output_component = Component ( ) ; return ; } output_component -> begin = output -> length ( ) ; int source_end = source_component . end ( ) ; for ( int i = source_component . begin ; i < source_end ; i ++ ) output -> push_back ( source [ i ] ) ; output_component -> set_len ( output -> length ( ) - output_component -> begin ) ; }
Copies a single component from the source to the output.
Copies a single component from the source to the output .
// This component is not present.