Ninja
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
IncludesNormalize Struct Reference

Utility functions for normalizing include paths on Windows. More...

#include <includes_normalize.h>

Public Member Functions

 IncludesNormalize (const std::string &relative_to)
 Normalize path relative to |relative_to|. More...
 
bool Normalize (const std::string &input, std::string *result, std::string *err) const
 Normalize by fixing slashes style, fixing redundant . More...
 

Static Public Member Functions

static std::string AbsPath (StringPiece s, std::string *err)
 
static std::string Relativize (StringPiece path, const std::vector< StringPiece > &start_list, std::string *err)
 

Private Attributes

std::string relative_to_
 
std::vector< StringPiecesplit_relative_to_
 

Detailed Description

Utility functions for normalizing include paths on Windows.

TODO: this likely duplicates functionality of CanonicalizePath; refactor.

Definition at line 25 of file includes_normalize.h.

Constructor & Destructor Documentation

◆ IncludesNormalize()

IncludesNormalize::IncludesNormalize ( const std::string &  relative_to)

Normalize path relative to |relative_to|.

Definition at line 129 of file includes_normalize-win32.cc.

References Fatal(), and SplitStringPiece().

Member Function Documentation

◆ AbsPath()

string IncludesNormalize::AbsPath ( StringPiece  s,
std::string *  err 
)
static

Definition at line 138 of file includes_normalize-win32.cc.

References StringPiece::AsString().

Referenced by TEST().

◆ Normalize()

bool IncludesNormalize::Normalize ( const std::string &  input,
std::string *  result,
std::string *  err 
) const

Normalize by fixing slashes style, fixing redundant .

. and . and makes the path |input| relative to |this->relative_to_| and store to |result|.

Definition at line 184 of file includes_normalize-win32.cc.

References StringPiece::AsString(), and CanonicalizePath().

Referenced by CLParser::Parse(), and TEST().

◆ Relativize()

string IncludesNormalize::Relativize ( StringPiece  path,
const std::vector< StringPiece > &  start_list,
std::string *  err 
)
static

Member Data Documentation

◆ relative_to_

std::string IncludesNormalize::relative_to_
private

Definition at line 41 of file includes_normalize.h.

◆ split_relative_to_

std::vector<StringPiece> IncludesNormalize::split_relative_to_
private

Definition at line 42 of file includes_normalize.h.


The documentation for this struct was generated from the following files: