XRootD
Loading...
Searching...
No Matches
Macaroons Namespace Reference

Classes

class  Authz
class  Handler

Enumerations

enum  LogMask {
  Debug = 0x01 ,
  Info = 0x02 ,
  Warning = 0x04 ,
  Error = 0x08 ,
  All = 0xff
}

Functions

std::string NormalizeSlashes (const std::string &)

Enumeration Type Documentation

◆ LogMask

Enumerator
Debug 
Info 
Warning 
Error 
All 

Definition at line 16 of file XrdMacaroonsHandler.hh.

16 {
17 Debug = 0x01,
18 Info = 0x02,
19 Warning = 0x04,
20 Error = 0x08,
21 All = 0xff
22};

Function Documentation

◆ NormalizeSlashes()

std::string Macaroons::NormalizeSlashes ( const std::string & input)

Definition at line 57 of file XrdMacaroonsHandler.cc.

58{
59 std::string output;
60 // In most cases, the output should be "about as large"
61 // as the input
62 output.reserve(input.size());
63 char prior_chr = '\0';
64 size_t output_idx = 0;
65 for (size_t idx = 0; idx < input.size(); idx++) {
66 char chr = input[idx];
67 if (prior_chr == '/' && chr == '/') {
68 output_idx++;
69 continue;
70 }
71 output += input[output_idx];
72 prior_chr = chr;
73 output_idx++;
74 }
75 return output;
76}