WPILibC++ 2025.3.1
Loading...
Searching...
No Matches
wpi Namespace Reference

Foonathan namespace. More...

Namespaces

namespace  adl_detail
 
namespace  densemap
 
namespace  detail
 These are wrappers over isa* function that allow them to be used in generic algorithms such as wpi:all_of, wpi::none_of, etc.
 
namespace  detail_expected
 
namespace  details
 
namespace  hashing
 
namespace  impl
 
namespace  java
 Java Native Interface (JNI) utility functions.
 
namespace  literals
 
namespace  log
 
namespace  math
 
namespace  memory
 Memory namespace.
 
namespace  pointer_union_detail
 
namespace  sig
 
namespace  structparser
 
namespace  support
 
namespace  sys
 
namespace  uv
 

Classes

struct  add_const_past_pointer
 If T is a pointer to X, return a pointer to const X. More...
 
struct  add_const_past_pointer< T, std::enable_if_t< std::is_pointer_v< T > > >
 
struct  add_lvalue_reference_if_not_pointer
 If T is a pointer, just return it. If it is not, return T&. More...
 
struct  add_lvalue_reference_if_not_pointer< T, std::enable_if_t< std::is_pointer_v< T > > >
 
struct  AlignedCharArrayUnion
 A suitably aligned and sized character array member which can hold elements of any type. More...
 
class  AllocatorBase
 CRTP base class providing obvious overloads for the core Allocate() methods of LLVM-style allocators. More...
 
class  Argument
 
class  ArgumentParser
 
class  array
 This class is a wrapper around std::array that does compile time size checking. More...
 
class  bad_expected_access
 
class  buffer_ostream
 
class  buffer_unique_ostream
 
struct  CalculateSmallVectorDefaultInlinedElements
 Helper class for calculating the default number of inline elements for SmallVector<T>. More...
 
class  CallbackListenerData
 
class  CallbackManager
 
class  CallbackThread
 
struct  cast_convert_val
 
struct  cast_convert_val< To, FromTy *, FromTy * >
 
struct  cast_convert_val< To, FromTy, FromTy >
 
struct  cast_retty
 
struct  cast_retty_impl
 
struct  cast_retty_impl< To, const From * >
 
struct  cast_retty_impl< To, const From *const >
 
struct  cast_retty_impl< To, const From >
 
struct  cast_retty_impl< To, From * >
 
struct  cast_retty_impl< To, std::unique_ptr< From > >
 
struct  cast_retty_wrap
 
struct  cast_retty_wrap< To, FromTy, FromTy >
 
struct  CastInfo
 This struct provides a method for customizing the way a cast is performed. More...
 
struct  CastInfo< To, const PointerUnion< PTs... > >
 
struct  CastInfo< To, From, std::enable_if_t<!is_simple_type< From >::value > >
 This struct provides an overload for CastInfo where From has simplify_type defined. More...
 
struct  CastInfo< To, PointerUnion< PTs... > >
 
struct  CastInfo< To, std::optional< From > >
 Provide a CastInfo specialized for std::optional<From>. More...
 
struct  CastInfo< To, std::unique_ptr< From > >
 Provide a CastInfo specialized for std::unique_ptr. More...
 
struct  CastInfoPointerUnionImpl
 We can't (at least, at this moment with C++14) declare CastInfo as a friend of PointerUnion like this: More...
 
struct  CastIsPossible
 This struct provides a way to check if a given cast is possible. More...
 
struct  CastIsPossible< To, From, std::enable_if_t< std::is_base_of_v< To, From > > >
 Upcasting (from derived to base) and casting from a type to itself should always be possible. More...
 
struct  CastIsPossible< To, std::optional< From > >
 
class  circular_buffer
 This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
 
struct  const_pointer_or_const_ref
 
struct  const_pointer_or_const_ref< T, std::enable_if_t< std::is_pointer_v< T > > >
 
struct  ConstStrippingForwardingCast
 Provides a cast trait that strips const from types to make it easier to implement a const-version of a non-const cast. More...
 
struct  ct_string
 Fixed length string (array of character) for compile time use. More...
 
class  DebugEpochBase
 A base class for data structure classes wishing to make iterators ("handles") pointing into themselves fail-fast. More...
 
struct  DefaultDoCastIfPossible
 This cast trait just provides the default implementation of doCastIfPossible to make CastInfo specializations more declarative. More...
 
class  DenseMap
 
class  DenseMapBase
 
struct  DenseMapInfo
 An information struct used to provide DenseMap with the various necessary components for a given value type T. More...
 
struct  DenseMapInfo< char >
 
struct  DenseMapInfo< Enum, std::enable_if_t< std::is_enum_v< Enum > > >
 
struct  DenseMapInfo< hash_code, void >
 
struct  DenseMapInfo< int >
 
struct  DenseMapInfo< long >
 
struct  DenseMapInfo< long long >
 
struct  DenseMapInfo< PointerIntPair< PointerTy, IntBits, IntType >, void >
 
struct  DenseMapInfo< PointerUnion< PTs... > >
 
struct  DenseMapInfo< short >
 
struct  DenseMapInfo< std::pair< T, U > >
 
struct  DenseMapInfo< std::tuple< Ts... > >
 
struct  DenseMapInfo< std::variant< Ts... > >
 
struct  DenseMapInfo< T * >
 
struct  DenseMapInfo< unsigned >
 
struct  DenseMapInfo< unsigned char >
 
struct  DenseMapInfo< unsigned long >
 
struct  DenseMapInfo< unsigned long long >
 
struct  DenseMapInfo< unsigned short >
 
class  DenseMapIterator
 
class  DirectUnpackCallback
 A callback method that will directly unpack elements into the specified vector like data structure. More...
 
class  DsClient
 
class  DynamicStruct
 Dynamic (run-time) read-only access to a serialized raw struct. More...
 
class  DynamicStructObject
 Dynamic (run-time) mutable access to a serialized raw struct, with internal data storage. More...
 
struct  empty_array_t
 
class  Event
 An atomic signaling event for synchronization. More...
 
class  EventLoopRunner
 Executes an event loop on a separate thread. More...
 
struct  EventVector
 
class  expected
 An expected<T, E> object is an object that contains the storage for another object and manages the lifetime of this contained object T. More...
 
struct  explicitly_convertible
 
struct  explicitly_convertible< From, To, std::void_t< decltype(static_cast< To >(std::declval< std::add_rvalue_reference_t< From > >()))> >
 
class  FastQueue
 
class  FileLogger
 A class version of tail -f, otherwise known as tail -f at home. More...
 
struct  FirstIndexOfType
 Find the first index where a type appears in a list of types. More...
 
struct  FirstIndexOfType< T, T, Us... >
 
struct  FirstIndexOfType< T, U, Us... >
 
struct  ForwardToPointerCast
 Provides a cast trait that uses a defined pointer to pointer cast as a base for reference-to-reference casts. More...
 
class  function_ref
 An efficient, type-erasing, non-owning reference to a callable. More...
 
class  function_ref< Ret(Params...)>
 
struct  FunctionPointerLikeTypeTraits
 Provide suitable custom traits struct for function pointers. More...
 
class  future
 A lightweight version of std::future. More...
 
class  future< void >
 Explicit specialization for future<void>. More...
 
class  hash_code
 An opaque object representing a hash code. More...
 
class  HashBuilder
 
struct  http_parser
 
struct  http_parser_settings
 
struct  http_parser_url
 
class  HttpConnection
 
class  HttpLocation
 
class  HttpMultipartScanner
 
class  HttpParser
 HTTP protocol parser. More...
 
class  HttpPath
 Class for HTTP path matching. More...
 
class  HttpPathRef
 Proxy reference object for a portion of a HttpPath. More...
 
class  HttpQueryMap
 Map for looking up elements of the query portion of a URI. More...
 
class  HttpRequest
 
class  HttpServerConnection
 
class  HttpWebSocketServerConnection
 A server-side HTTP connection that also accepts WebSocket upgrades. More...
 
struct  in_place_t
 
class  interpolating_map
 Implements a table of key-value pairs with linear interpolation between values. More...
 
class  is_integral_or_enum
 Metafunction that determines whether the given type is either an integral type or an enumeration type, including enum classes. More...
 
struct  is_simple_type
 
struct  isa_impl
 
struct  isa_impl< To, From, std::enable_if_t< std::is_base_of_v< To, From > > >
 
struct  isa_impl_cl
 
struct  isa_impl_cl< To, const From * >
 
struct  isa_impl_cl< To, const From *const >
 
struct  isa_impl_cl< To, const From >
 
struct  isa_impl_cl< To, const std::unique_ptr< From > >
 
struct  isa_impl_cl< To, From * >
 
struct  isa_impl_cl< To, From *const >
 
struct  isa_impl_wrap
 
struct  isa_impl_wrap< To, FromTy, FromTy >
 
class  iterator_adaptor_base
 CRTP base class for adapting an iterator to a different type. More...
 
class  iterator_facade_base
 CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of the interface. More...
 
class  iterator_range
 A range adaptor for a pair of iterators. More...
 
class  Logger
 
class  MallocAllocator
 
class  MappedFileRegion
 
class  MapVector
 This class implements a map that also provides access to all stored values in a deterministic order. More...
 
class  MemoryBuffer
 This interface provides simple read-only access to a block of memory, and provides simple methods for reading files and standard input into a memory buffer. More...
 
class  MemoryBufferRef
 
class  monostate
 
class  MulticastServiceAnnouncer
 
class  MulticastServiceResolver
 
class  MutableDynamicStruct
 Dynamic (run-time) mutable access to a serialized raw struct. More...
 
class  NetworkAcceptor
 
class  NetworkStream
 
struct  NullableValueCastFailed
 All of these cast traits are meant to be implementations for useful casts that users may want to use that are outside the standard behavior. More...
 
struct  NullDeleter
 
struct  OptionalValueCast
 This cast trait provides std::optional<T> casting. More...
 
class  PackCallback
 A callback method that will pack elements when called. More...
 
class  ParallelTcpConnector
 Parallel TCP connector. More...
 
struct  pointee_iterator
 An iterator type that allows iterating over the pointees via some other iterator. More...
 
class  pointer_iterator
 
class  PointerIntPair
 PointerIntPair - This class implements a pair of a pointer and small integer. More...
 
struct  PointerIntPairInfo
 
struct  PointerLikeTypeTraits
 A traits type that is used to handle pointer types and things that are just wrappers for pointers as a uniform entity. More...
 
struct  PointerLikeTypeTraits< const T * >
 
struct  PointerLikeTypeTraits< const T >
 
struct  PointerLikeTypeTraits< PointerIntPair< PointerTy, IntBits, IntType, PtrTraits > >
 
struct  PointerLikeTypeTraits< PointerUnion< PTs... > >
 
struct  PointerLikeTypeTraits< ReturnT(*)(ParamTs...)>
 Provide a default specialization for function pointers that assumes 4-byte alignment. More...
 
struct  PointerLikeTypeTraits< T * >
 
struct  PointerLikeTypeTraits< uintptr_t >
 
struct  PointerLikeTypeTraits< void * >
 
class  PointerUnion
 A discriminated union of two or more pointer types, with the discriminator in the low bit of the pointer. More...
 
class  PortForwarder
 Forward ports to another host. More...
 
class  priority_queue
 This class is the same as std::priority_queue with two changes: More...
 
class  promise
 A lightweight version of std::promise. More...
 
class  promise< void >
 Explicit specialization for promise<void>. More...
 
class  PromiseFactory
 A promise factory for lightweight futures. More...
 
class  PromiseFactory< void >
 Explicit specialization for PromiseFactory<void>. More...
 
struct  Protobuf
 Protobuf serialization template. More...
 
struct  Protobuf< frc::ArmFeedforward >
 
struct  Protobuf< frc::ChassisSpeeds >
 
struct  Protobuf< frc::CubicHermiteSpline >
 
struct  Protobuf< frc::DCMotor >
 
struct  Protobuf< frc::DifferentialDriveFeedforward >
 
struct  Protobuf< frc::DifferentialDriveKinematics >
 
struct  Protobuf< frc::DifferentialDriveWheelPositions >
 
struct  Protobuf< frc::DifferentialDriveWheelSpeeds >
 
struct  Protobuf< frc::DifferentialDriveWheelVoltages >
 
struct  Protobuf< frc::ElevatorFeedforward >
 
struct  Protobuf< frc::Ellipse2d >
 
struct  Protobuf< frc::LinearSystem< States, Inputs, Outputs > >
 
struct  Protobuf< frc::Matrixd< Rows, Cols, Options, MaxRows, MaxCols > >
 
struct  Protobuf< frc::Matrixd< Size, 1, Options, MaxRows, MaxCols > >
 
struct  Protobuf< frc::MecanumDriveKinematics >
 
struct  Protobuf< frc::MecanumDriveWheelPositions >
 
struct  Protobuf< frc::MecanumDriveWheelSpeeds >
 
struct  Protobuf< frc::Pose2d >
 
struct  Protobuf< frc::Pose3d >
 
struct  Protobuf< frc::Quaternion >
 
struct  Protobuf< frc::QuinticHermiteSpline >
 
struct  Protobuf< frc::Rectangle2d >
 
struct  Protobuf< frc::Rotation2d >
 
struct  Protobuf< frc::Rotation3d >
 
struct  Protobuf< frc::SimpleMotorFeedforward< Distance > >
 
struct  Protobuf< frc::SwerveDriveKinematics< NumModules > >
 
struct  Protobuf< frc::SwerveModulePosition >
 
struct  Protobuf< frc::SwerveModuleState >
 
struct  Protobuf< frc::Trajectory >
 
struct  Protobuf< frc::Trajectory::State >
 
struct  Protobuf< frc::Transform2d >
 
struct  Protobuf< frc::Transform3d >
 
struct  Protobuf< frc::Translation2d >
 
struct  Protobuf< frc::Translation3d >
 
struct  Protobuf< frc::Twist2d >
 
struct  Protobuf< frc::Twist3d >
 
class  ProtobufMessage
 Ease of use wrapper to make nanopb streams more opaque to the user. More...
 
class  ProtobufMessageDatabase
 Database of protobuf dynamic messages. More...
 
class  ProtoInputStream
 Class for wrapping a nanopb istream. More...
 
class  ProtoOutputStream
 Class for wrapping a nanopb ostream. More...
 
class  raw_fd_istream
 
class  raw_fd_ostream
 A raw_ostream that writes to a file descriptor. More...
 
class  raw_fd_stream
 A raw_ostream of a file for reading/writing/seeking. More...
 
class  raw_istream
 
class  raw_mem_istream
 
class  raw_null_ostream
 A raw_ostream that discards all output. More...
 
class  raw_os_ostream
 raw_os_ostream - A raw_ostream that writes to an std::ostream. More...
 
class  raw_ostream
 This class implements an extremely fast bulk output stream that can only output to a stream. More...
 
class  raw_pwrite_stream
 An abstract base class for streams implementations that also support a pwrite operation. More...
 
class  raw_socket_istream
 
class  raw_socket_ostream
 
class  raw_string_ostream
 A raw_ostream that writes to an std::string. More...
 
class  raw_svector_ostream
 A raw_ostream that writes to an SmallVector or SmallString. More...
 
class  raw_usvector_ostream
 A raw_ostream that writes to an SmallVector or SmallString. More...
 
class  raw_uv_ostream
 raw_ostream style output to a SmallVector of uv::Buffer buffers. More...
 
class  raw_uvector_ostream
 A raw_ostream that writes to a vector. More...
 
class  raw_vector_ostream
 A raw_ostream that writes to a vector. More...
 
struct  RawFrame
 
class  recursive_spinlock1
 A recursive spinlock mutex. More...
 
class  recursive_spinlock2
 A recursive spinlock mutex. More...
 
struct  remove_cvref
 
class  rotated_span
 This is a simple rotated span view. More...
 
class  SafeThread
 
class  SafeThreadBase
 Base class for SafeThreadOwner threads. More...
 
class  SafeThreadEvent
 
class  SafeThreadOwner
 
struct  SameType
 
class  scope_exit
 
struct  ScopedFatalErrorHandler
 ScopedFatalErrorHandler - This is a simple helper class which just calls install_fatal_error_handler in its constructor and remove_fatal_error_handler in its destructor. More...
 
class  Semaphore
 A semaphore for synchronization. More...
 
class  Sendable
 Interface for Sendable objects. More...
 
class  SendableBuilder
 Helper class for building Sendable dashboard representations. More...
 
class  SendableHelper
 A helper class for use with objects that add themselves to SendableRegistry. More...
 
class  SendableRegistry
 The SendableRegistry class is the public interface for registering sensors and actuators for use on dashboards and LiveWindow. More...
 
class  SHA1
 
class  SignalObject
 RAII wrapper for signaling handles. More...
 
struct  simplify_type
 Define a template that can be specialized by smart pointers to reflect the fact that they are automatically dereferenced, and are not involved with the template selection process... the default implementation is a noop. More...
 
struct  simplify_type< const From >
 
class  SmallDenseMap
 
struct  SmallMapVector
 A MapVector that performs no allocations if smaller than a certain size. More...
 
class  SmallPtrSet
 SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements. More...
 
class  SmallPtrSetImpl
 A templated base class for SmallPtrSet which provides the typesafe interface that is common across all small sizes. More...
 
class  SmallPtrSetImplBase
 SmallPtrSetImplBase - This is the common code shared among all the SmallPtrSet<>'s, which is almost everything. More...
 
class  SmallPtrSetIterator
 SmallPtrSetIterator - This implements a const_iterator for SmallPtrSet. More...
 
class  SmallPtrSetIteratorImpl
 SmallPtrSetIteratorImpl - This is the common base class shared between all instances of SmallPtrSetIterator. More...
 
class  SmallSet
 SmallSet - This maintains a set of unique values, optimizing for the case when the set is small (less than N). More...
 
class  SmallSet< PointeeType *, N >
 If this set is of pointer values, transparently switch over to using SmallPtrSet for performance. More...
 
class  SmallSetIterator
 SmallSetIterator - This class implements a const_iterator for SmallSet by delegating to the underlying SmallVector or Set iterators. More...
 
class  SmallString
 SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better as a string (e.g. More...
 
class  SmallVector
 This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small. More...
 
struct  SmallVectorAlignmentAndSize
 Figure out the offset of the first element. More...
 
class  SmallVectorBase
 This is all the stuff common to all SmallVectors. More...
 
class  SmallVectorImpl
 This class consists of common code factored out of the SmallVector class to reduce code duplication based on the SmallVector 'N' template parameter. More...
 
class  SmallVectorMemoryBuffer
 SmallVector-backed MemoryBuffer instance. More...
 
struct  SmallVectorStorage
 Storage for the SmallVector elements. More...
 
struct  SmallVectorStorage< T, 0 >
 We need the storage to be properly aligned even for small-size of 0 so that the pointer math in SmallVectorTemplateCommon::getFirstEl() is well-defined. More...
 
class  SmallVectorTemplateBase
 SmallVectorTemplateBase<TriviallyCopyable = false> - This is where we put method implementations that are designed to work with non-trivial T's. More...
 
class  SmallVectorTemplateBase< T, true >
 SmallVectorTemplateBase<TriviallyCopyable = true> - This is where we put method implementations that are designed to work with trivially copyable T's. More...
 
class  SmallVectorTemplateCommon
 This is the part of SmallVectorTemplateBase which does not depend on whether the type T is a POD. More...
 
class  spinlock
 A spinlock mutex. More...
 
class  static_circular_buffer
 This is a simple circular buffer so we don't need to "bucket brigade" copy old values. More...
 
class  StdVectorUnpackCallback
 A DirectUnpackCallback backed by a std::vector. More...
 
class  StringMap
 StringMap is a sorted associative container that contains key-value pairs with unique string keys. More...
 
struct  Struct
 Struct serialization template. More...
 
struct  Struct< bool >
 Raw struct support for boolean values. More...
 
struct  Struct< double >
 Raw struct support for double values. More...
 
struct  Struct< float >
 Raw struct support for float values. More...
 
struct  Struct< frc::ArmFeedforward >
 
struct  Struct< frc::ChassisSpeeds >
 
struct  Struct< frc::CubicHermiteSpline >
 
struct  Struct< frc::DCMotor >
 
struct  Struct< frc::DifferentialDriveFeedforward >
 
struct  Struct< frc::DifferentialDriveKinematics >
 
struct  Struct< frc::DifferentialDriveWheelPositions >
 
struct  Struct< frc::DifferentialDriveWheelSpeeds >
 
struct  Struct< frc::DifferentialDriveWheelVoltages >
 
struct  Struct< frc::ElevatorFeedforward >
 
struct  Struct< frc::Ellipse2d >
 
struct  Struct< frc::LinearSystem< States, Inputs, Outputs > >
 
struct  Struct< frc::Matrixd< Rows, Cols, Options, MaxRows, MaxCols > >
 
struct  Struct< frc::Matrixd< Size, 1, Options, MaxRows, MaxCols > >
 
struct  Struct< frc::MecanumDriveKinematics >
 
struct  Struct< frc::MecanumDriveWheelPositions >
 
struct  Struct< frc::MecanumDriveWheelSpeeds >
 
struct  Struct< frc::Pose2d >
 
struct  Struct< frc::Pose3d >
 
struct  Struct< frc::Quaternion >
 
struct  Struct< frc::QuinticHermiteSpline >
 
struct  Struct< frc::Rectangle2d >
 
struct  Struct< frc::Rotation2d >
 
struct  Struct< frc::Rotation3d >
 
struct  Struct< frc::SimpleMotorFeedforward< Distance > >
 
struct  Struct< frc::SwerveDriveKinematics< NumModules > >
 
struct  Struct< frc::SwerveModulePosition >
 
struct  Struct< frc::SwerveModuleState >
 
struct  Struct< frc::Transform2d >
 
struct  Struct< frc::Transform3d >
 
struct  Struct< frc::Translation2d >
 
struct  Struct< frc::Translation3d >
 
struct  Struct< frc::Twist2d >
 
struct  Struct< frc::Twist3d >
 
struct  Struct< int16_t >
 Raw struct support for int16_t values. More...
 
struct  Struct< int32_t >
 Raw struct support for int32_t values. More...
 
struct  Struct< int64_t >
 Raw struct support for int64_t values. More...
 
struct  Struct< int8_t >
 Raw struct support for int8_t values. More...
 
struct  Struct< std::array< T, N >, I... >
 Raw struct support for fixed-size arrays of other structs. More...
 
struct  Struct< uint16_t >
 Raw struct support for uint16_t values. More...
 
struct  Struct< uint32_t >
 Raw struct support for uint32_t values. More...
 
struct  Struct< uint64_t >
 Raw struct support for uint64_t values. More...
 
struct  Struct< uint8_t >
 Raw struct support for uint8_t values. More...
 
class  StructArrayBuffer
 
class  StructDescriptor
 Raw struct dynamic struct descriptor. More...
 
class  StructDescriptorDatabase
 Database of raw struct dynamic descriptors. More...
 
class  StructFieldDescriptor
 Raw struct dynamic field descriptor. More...
 
class  TCPAcceptor
 
class  TCPConnector
 
class  TCPStream
 
struct  TypesAreDistinct
 Determine if all types in Ts are distinct. More...
 
struct  TypesAreDistinct<>
 
class  UDPClient
 
class  UidVector
 Vector which provides an integrated freelist for removal and reuse of individual elements. More...
 
class  Uleb128Reader
 Unsigned LEB128 streaming reader. More...
 
struct  unexpect_t
 
class  unexpected
 
class  unique_function
 unique_function is a type-erasing functor similar to std::function. More...
 
class  unique_function< R(P...) const >
 
class  unique_function< R(P...)>
 
struct  UniquePtrCast
 This cast trait provides std::unique_ptr casting. More...
 
class  UnpackCallback
 A DirectUnpackCallback backed by a SmallVector<T, N>. More...
 
class  UrlParser
 Parses a URL into its constituent components. More...
 
struct  ValueFromPointerCast
 This cast trait provides casting for the specific case of casting to a value-typed object from a pointer-typed object. More...
 
struct  ValueIsPresent
 ValueIsPresent provides a way to check if a value is, well, present. More...
 
struct  ValueIsPresent< std::optional< T > >
 
struct  ValueIsPresent< T, std::enable_if_t< IsNullable< T > > >
 
class  VersionTuple
 Represents a version number in the form major[.minor[.subminor[.build]]]. More...
 
class  WebServer
 A web server using the HTTP protocol. More...
 
class  WebSocket
 RFC 6455 compliant WebSocket client and server implementation. More...
 
class  WebSocketServer
 Dedicated WebSocket server. More...
 
class  WebSocketServerHelper
 WebSocket HTTP server helper. More...
 
class  WorkerThread
 
class  WorkerThread< R(T...)>
 
struct  WpiArrayEmplaceWrapper
 A wrapper around a wpi::array that lets us treat it as a limited sized vector. More...
 
struct  WpiArrayUnpackCallback
 A DirectUnpackCallback backed by a wpi::array<T, N>. More...
 
class  WritableMemoryBuffer
 This class is an extension of MemoryBuffer, which allows copy-on-write access to the underlying contents. More...
 
class  WriteThroughMemoryBuffer
 This class is an extension of MemoryBuffer, which allows write access to the underlying contents and committing those changes to the original source. More...
 
struct  XXH128_hash_t
 The return value from 128-bit hashes. More...
 

Concepts

concept  StringLike
 
concept  ConstVectorLike
 
concept  MutableVectorLike
 
concept  PackBytes
 
concept  UnpackBytes
 
concept  ProtoEnumeration
 
concept  ProtoPackable
 
concept  ProtoCallbackPackable
 
concept  ProtoCallbackUnpackable
 
concept  DecayedDerivedFrom
 
concept  StructSerializable
 Specifies that a type is capable of raw struct serialization and deserialization.
 
concept  MutableStructSerializable
 Specifies that a type is capable of in-place raw struct deserialization.
 
concept  HasNestedStruct
 Specifies that a struct type has nested struct declarations.
 
concept  ProtobufSerializable
 Specifies that a type is capable of protobuf serialization and deserialization.
 
concept  MutableProtobufSerializable
 Specifies that a type is capable of in-place protobuf deserialization.
 

Typedefs

using mutex = ::std::mutex
 
using recursive_mutex = ::std::recursive_mutex
 
using condition_variable = ::std::condition_variable
 
template<typename T , typename U >
using enableif_int
 Some template parameter helpers to optimize for bitwidth, for functions that take multiple arguments.
 
template<typename T , typename U , typename = enableif_int<T, U>>
using common_uint
 
template<typename T , typename U , typename = enableif_int<T, U>>
using common_sint
 
using stack_float_t = float
 Type to force float point values onto the stack, so that x86 doesn't add hidden precision, avoiding rounding differences on various platforms.
 
typedef int(* http_data_cb) (http_parser *, const char *at, size_t length)
 
typedef int(* http_cb) (http_parser *)
 
template<typename WrappedIteratorT , typename T1 = std::remove_reference_t<decltype( **std::declval<WrappedIteratorT>())>, typename T2 = std::add_pointer_t<T1>>
using raw_pointer_iterator
 
typedef void(* fatal_error_handler_t) (void *user_data, const char *reason, bool gen_crash_diag)
 An error handler callback.
 
using recursive_spinlock = recursive_spinlock1
 
typedef unsigned int UTF32
 
typedef unsigned short UTF16
 
typedef unsigned char UTF8
 
typedef bool Boolean
 
template<class Iterator >
using EnableIfConvertibleToInputIterator
 
template<typename RangeType >
using ValueTypeFromRangeType
 
template<size_t I, typename... Ts>
using TypeAtIndex = std::tuple_element_t<I, std::tuple<Ts...>>
 Find the type at a given index in a list of types.
 

Enumerations

enum class  DecodeLimits { Ignore , Add , Fail }
 The behavior to use when more elements are in the message then expected when decoding. More...
 
enum  http_status
 
enum  http_method
 
enum  http_parser_type { HTTP_REQUEST , HTTP_RESPONSE , HTTP_BOTH }
 
enum  flags {
  F_CHUNKED = 1 << 0 , F_CONNECTION_KEEP_ALIVE = 1 << 1 , F_CONNECTION_CLOSE = 1 << 2 , F_CONNECTION_UPGRADE = 1 << 3 ,
  F_TRAILING = 1 << 4 , F_UPGRADE = 1 << 5 , F_SKIPBODY = 1 << 6 , F_CONTENTLENGTH = 1 << 7
}
 
enum  http_errno
 
enum  http_parser_url_fields {
  UF_SCHEMA = 0 , UF_HOST = 1 , UF_PORT = 2 , UF_PATH = 3 ,
  UF_QUERY = 4 , UF_FRAGMENT = 5 , UF_USERINFO = 6 , UF_MAX = 7
}
 
enum class  endianness { big , little , native = little }
 
enum  LogLevel {
  WPI_LOG_CRITICAL = 50 , WPI_LOG_ERROR = 40 , WPI_LOG_WARNING = 30 , WPI_LOG_INFO = 20 ,
  WPI_LOG_DEBUG = 10 , WPI_LOG_DEBUG1 = 9 , WPI_LOG_DEBUG2 = 8 , WPI_LOG_DEBUG3 = 7 ,
  WPI_LOG_DEBUG4 = 6
}
 
enum class  errc {
  argument_list_too_long = int(std::errc::argument_list_too_long) , argument_out_of_domain = int(std::errc::argument_out_of_domain) , bad_address = int(std::errc::bad_address) , bad_file_descriptor = int(std::errc::bad_file_descriptor) ,
  broken_pipe = int(std::errc::broken_pipe) , delete_pending = -56 , device_or_resource_busy = int(std::errc::device_or_resource_busy) , directory_not_empty = int(std::errc::directory_not_empty) ,
  executable_format_error = int(std::errc::executable_format_error) , file_exists = int(std::errc::file_exists) , file_too_large = int(std::errc::file_too_large) , filename_too_long = int(std::errc::filename_too_long) ,
  function_not_supported = int(std::errc::function_not_supported) , illegal_byte_sequence = int(std::errc::illegal_byte_sequence) , inappropriate_io_control_operation , interrupted = int(std::errc::interrupted) ,
  invalid_argument = int(std::errc::invalid_argument) , invalid_seek = int(std::errc::invalid_seek) , io_error = int(std::errc::io_error) , is_a_directory = int(std::errc::is_a_directory) ,
  no_child_process = int(std::errc::no_child_process) , no_lock_available = int(std::errc::no_lock_available) , no_space_on_device = int(std::errc::no_space_on_device) , no_such_device_or_address = int(std::errc::no_such_device_or_address) ,
  no_such_device = int(std::errc::no_such_device) , no_such_file_or_directory = int(std::errc::no_such_file_or_directory) , no_such_process = int(std::errc::no_such_process) , not_a_directory = int(std::errc::not_a_directory) ,
  not_enough_memory = int(std::errc::not_enough_memory) , not_supported = int(std::errc::not_supported) , operation_not_permitted = int(std::errc::operation_not_permitted) , permission_denied = int(std::errc::permission_denied) ,
  read_only_file_system = int(std::errc::read_only_file_system) , resource_deadlock_would_occur = int(std::errc::resource_deadlock_would_occur) , resource_unavailable_try_again , result_out_of_range = int(std::errc::result_out_of_range) ,
  too_many_files_open_in_system = int(std::errc::too_many_files_open_in_system) , too_many_files_open = int(std::errc::too_many_files_open) , too_many_links = int(std::errc::too_many_links)
}
 
enum class  StructFieldType {
  kBool , kChar , kInt8 , kInt16 ,
  kInt32 , kInt64 , kUint8 , kUint16 ,
  kUint32 , kUint64 , kFloat , kDouble ,
  kStruct
}
 Known data types for raw struct dynamic fields (see StructFieldDescriptor). More...
 
enum  ConversionResult { conversionOK , sourceExhausted , targetExhausted , sourceIllegal }
 
enum  ConversionFlags { strictConversion = 0 , lenientConversion }
 
enum class  nargs_pattern { optional , any , at_least_one }
 
enum class  default_arguments : unsigned int { none = 0 , help = 1 , version = 2 , all = help | version }
 

Functions

LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_malloc (size_t Sz)
 
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_calloc (size_t Count, size_t Sz)
 
LLVM_ATTRIBUTE_RETURNS_NONNULL void * safe_realloc (void *Ptr, size_t Sz)
 
LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * allocate_buffer (size_t Size, size_t Alignment)
 Allocate a buffer of memory with the given size and alignment.
 
void deallocate_buffer (void *Ptr, size_t Size, size_t Alignment)
 Deallocate a buffer of memory with the given size and alignment.
 
template<std::size_t I, typename PointerTy , unsigned IntBits, typename IntType , typename PtrTraits , typename Info >
decltype(auto) get (const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > &Pair)
 
template<typename To , typename From >
bool isa (const From &Val)
 isa<X> - Return true if the parameter to the template is an instance of one of the template type arguments.
 
template<typename First , typename Second , typename... Rest, typename From >
bool isa (const From &Val)
 
template<typename To , typename From >
decltype(auto) cast (const From &Val)
 cast<X> - Return the argument parameter cast to the specified type.
 
template<typename To , typename From >
decltype(auto) cast (From &Val)
 
template<typename To , typename From >
decltype(auto) cast (From *Val)
 
template<typename To , typename From >
decltype(auto) cast (std::unique_ptr< From > &&Val)
 
template<typename To , typename From >
decltype(auto) dyn_cast (const From &Val)
 dyn_cast<X> - Return the argument parameter cast to the specified type.
 
template<typename To , typename From >
decltype(auto) dyn_cast (From &Val)
 
template<typename To , typename From >
decltype(auto) dyn_cast (From *Val)
 
template<typename To , typename From >
decltype(auto) dyn_cast (std::unique_ptr< From > &Val)
 
template<typename... X, class Y >
bool isa_and_present (const Y &Val)
 isa_and_present<X> - Functionally identical to isa, except that a null value is accepted.
 
template<typename... X, class Y >
bool isa_and_nonnull (const Y &Val)
 
template<class X , class Y >
auto cast_if_present (const Y &Val)
 cast_if_present<X> - Functionally identical to cast, except that a null value is accepted.
 
template<class X , class Y >
auto cast_if_present (Y &Val)
 
template<class X , class Y >
auto cast_if_present (Y *Val)
 
template<class X , class Y >
auto cast_if_present (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
auto cast_or_null (const Y &Val)
 
template<class X , class Y >
auto cast_or_null (Y &Val)
 
template<class X , class Y >
auto cast_or_null (Y *Val)
 
template<class X , class Y >
auto cast_or_null (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
auto dyn_cast_if_present (const Y &Val)
 dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case of optionals) value is accepted.
 
template<class X , class Y >
auto dyn_cast_if_present (Y &Val)
 
template<class X , class Y >
auto dyn_cast_if_present (Y *Val)
 
template<class X , class Y >
auto dyn_cast_or_null (const Y &Val)
 
template<class X , class Y >
auto dyn_cast_or_null (Y &Val)
 
template<class X , class Y >
auto dyn_cast_or_null (Y *Val)
 
template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType unique_dyn_cast (std::unique_ptr< Y > &Val)
 unique_dyn_cast<X> - Given a unique_ptr<Y>, try to return a unique_ptr<X>, taking ownership of the input pointer iff isa<X>(Val) is true.
 
template<class X , class Y >
auto unique_dyn_cast (std::unique_ptr< Y > &&Val)
 
template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType unique_dyn_cast_or_null (std::unique_ptr< Y > &Val)
 
template<class X , class Y >
auto unique_dyn_cast_or_null (std::unique_ptr< Y > &&Val)
 
std::string Demangle (std::string_view mangledSymbol)
 Demangle a C++ symbol.
 
template<typename T >
std::string GetTypeName (const T &type)
 Returns the type name of an object.
 
int SocketErrno ()
 
std::string SocketStrerror (int code)
 
std::string SocketStrerror ()
 
template<typename T >
maskTrailingOnes (unsigned N)
 Create a bitmask with the N right-most bits set to 1, and all other bits set to 0.
 
template<typename T >
maskLeadingOnes (unsigned N)
 Create a bitmask with the N left-most bits set to 1, and all other bits set to 0.
 
template<typename T >
maskTrailingZeros (unsigned N)
 Create a bitmask with the N right-most bits set to 0, and all other bits set to 1.
 
template<typename T >
maskLeadingZeros (unsigned N)
 Create a bitmask with the N left-most bits set to 0, and all other bits set to 1.
 
template<typename T >
reverseBits (T Val)
 Reverse the bits in Val.
 
constexpr uint32_t Hi_32 (uint64_t Value)
 Return the high 32 bits of a 64 bit value.
 
constexpr uint32_t Lo_32 (uint64_t Value)
 Return the low 32 bits of a 64 bit value.
 
constexpr uint64_t Make_64 (uint32_t High, uint32_t Low)
 Make a 64-bit integer from a high / low pair of 32-bit integers.
 
template<unsigned N>
constexpr bool isInt (int64_t x)
 Checks if an integer fits into the given bit width.
 
template<unsigned N, unsigned S>
constexpr bool isShiftedInt (int64_t x)
 Checks if a signed integer is an N bit number shifted left by S.
 
template<unsigned N>
constexpr bool isUInt (uint64_t x)
 Checks if an unsigned integer fits into the given bit width.
 
template<unsigned N, unsigned S>
constexpr bool isShiftedUInt (uint64_t x)
 Checks if a unsigned integer is an N bit number shifted left by S.
 
uint64_t maxUIntN (uint64_t N)
 Gets the maximum value for a N-bit unsigned integer.
 
int64_t minIntN (int64_t N)
 Gets the minimum value for a N-bit signed integer.
 
int64_t maxIntN (int64_t N)
 Gets the maximum value for a N-bit signed integer.
 
bool isUIntN (unsigned N, uint64_t x)
 Checks if an unsigned integer fits into the given (dynamic) bit width.
 
bool isIntN (unsigned N, int64_t x)
 Checks if an signed integer fits into the given (dynamic) bit width.
 
constexpr bool isMask_32 (uint32_t Value)
 Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (32 bit version).
 
constexpr bool isMask_64 (uint64_t Value)
 Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (64 bit version).
 
constexpr bool isShiftedMask_32 (uint32_t Value)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex.
 
constexpr bool isShiftedMask_64 (uint64_t Value)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.)
 
constexpr bool isPowerOf2_32 (uint32_t Value)
 Return true if the argument is a power of two > 0.
 
constexpr bool isPowerOf2_64 (uint64_t Value)
 Return true if the argument is a power of two > 0 (64 bit edition.)
 
bool isShiftedMask_32 (uint32_t Value, unsigned &MaskIdx, unsigned &MaskLen)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex.
 
bool isShiftedMask_64 (uint64_t Value, unsigned &MaskIdx, unsigned &MaskLen)
 Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.) If true, MaskIdx will specify the index of the lowest set bit and MaskLen is updated to specify the length of the mask, else neither are updated.
 
template<size_t kValue>
constexpr size_t CTLog2 ()
 Compile time Log2.
 
template<>
constexpr size_t CTLog2< 1 > ()
 
unsigned Log2_32 (uint32_t Value)
 Return the floor log base 2 of the specified value, -1 if the value is zero.
 
unsigned Log2_64 (uint64_t Value)
 Return the floor log base 2 of the specified value, -1 if the value is zero.
 
unsigned Log2_32_Ceil (uint32_t Value)
 Return the ceil log base 2 of the specified value, 32 if the value is zero.
 
unsigned Log2_64_Ceil (uint64_t Value)
 Return the ceil log base 2 of the specified value, 64 if the value is zero.
 
template<typename U , typename V , typename T = common_uint<U, V>>
constexpr T MinAlign (U A, V B)
 A and B are either alignments or offsets.
 
constexpr uint64_t MinAlign (uint64_t A, uint64_t B)
 Fallback when arguments aren't integral.
 
constexpr uint64_t NextPowerOf2 (uint64_t A)
 Returns the next power of two (in 64-bits) that is strictly greater than A.
 
uint64_t PowerOf2Ceil (uint64_t A)
 Returns the power of two which is greater than or equal to the given value.
 
template<typename U , typename V , typename T = common_uint<U, V>>
constexpr T divideCeil (U Numerator, V Denominator)
 Returns the integer ceil(Numerator / Denominator).
 
constexpr uint64_t divideCeil (uint64_t Numerator, uint64_t Denominator)
 Fallback when arguments aren't integral.
 
template<typename U , typename V >
constexpr bool divideSignedWouldOverflow (U Numerator, V Denominator)
 
template<typename U , typename V , typename T = common_sint<U, V>>
constexpr T divideCeilSigned (U Numerator, V Denominator)
 Returns the integer ceil(Numerator / Denominator).
 
template<typename U , typename V , typename T = common_sint<U, V>>
constexpr T divideFloorSigned (U Numerator, V Denominator)
 Returns the integer floor(Numerator / Denominator).
 
template<typename U , typename V , typename T = common_sint<U, V>>
constexpr T mod (U Numerator, V Denominator)
 Returns the remainder of the Euclidean division of LHS by RHS.
 
template<typename U , typename V , typename T = common_uint<U, V>>
constexpr T divideNearest (U Numerator, V Denominator)
 Returns (Numerator / Denominator) rounded by round-half-up.
 
template<typename U , typename V , typename T = common_uint<U, V>>
constexpr T alignTo (U Value, V Align)
 Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of Align.
 
constexpr uint64_t alignTo (uint64_t Value, uint64_t Align)
 Fallback when arguments aren't integral.
 
constexpr uint64_t alignToPowerOf2 (uint64_t Value, uint64_t Align)
 
template<typename U , typename V , typename W , typename T = common_uint<common_uint<U, V>, W>>
constexpr T alignTo (U Value, V Align, W Skew)
 If non-zero Skew is specified, the return value will be a minimal integer that is greater than or equal to Size and equal to A * N + Skew for some integer N.
 
template<auto Align, typename V , typename T = common_uint<decltype(Align), V>>
constexpr T alignTo (V Value)
 Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of Align.
 
template<typename U , typename V , typename W = uint8_t, typename T = common_uint<common_uint<U, V>, W>>
constexpr T alignDown (U Value, V Align, W Skew=0)
 Returns the largest unsigned integer less than or equal to Value and is Skew mod Align.
 
template<unsigned B>
constexpr int32_t SignExtend32 (uint32_t X)
 Sign-extend the number in the bottom B bits of X to a 32-bit integer.
 
int32_t SignExtend32 (uint32_t X, unsigned B)
 Sign-extend the number in the bottom B bits of X to a 32-bit integer.
 
template<unsigned B>
constexpr int64_t SignExtend64 (uint64_t x)
 Sign-extend the number in the bottom B bits of X to a 64-bit integer.
 
int64_t SignExtend64 (uint64_t X, unsigned B)
 Sign-extend the number in the bottom B bits of X to a 64-bit integer.
 
template<typename U , typename V , typename T = common_uint<U, V>>
constexpr T AbsoluteDifference (U X, V Y)
 Subtract two unsigned integers, X and Y, of type T and return the absolute value of the result.
 
template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingAdd (T X, T Y, bool *ResultOverflowed=nullptr)
 Add two unsigned integers, X and Y, of type T.
 
template<class T , class... Ts>
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingAdd (T X, T Y, T Z, Ts... Args)
 Add multiple unsigned integers of type T.
 
template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingMultiply (T X, T Y, bool *ResultOverflowed=nullptr)
 Multiply two unsigned integers, X and Y, of type T.
 
template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > SaturatingMultiplyAdd (T X, T Y, T A, bool *ResultOverflowed=nullptr)
 Multiply two unsigned integers, X and Y, and add the unsigned integer, A to the product.
 
template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > AddOverflow (T X, T Y, T &Result)
 Add two signed integers, computing the two's complement truncated result, returning true if overflow occurred.
 
template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > SubOverflow (T X, T Y, T &Result)
 Subtract two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.
 
template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > MulOverflow (T X, T Y, T &Result)
 Multiply two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.
 
template<typename T >
constexpr int sgn (T val)
 
template<typename T >
constexpr T Lerp (const T &startValue, const T &endValue, double t)
 Linearly interpolates between two values.
 
template<typename T , size_t N>
constexpr std::span< T > drop_front (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Drop the first N elements of the array.
 
template<typename T , size_t N>
constexpr std::span< T > drop_back (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Drop the last N elements of the array.
 
template<typename T , size_t N>
constexpr std::span< T > take_front (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Returns a span equal to in but with only the first n elements remaining.
 
template<typename T , size_t N>
constexpr std::span< T > take_back (std::span< T, N > in, typename std::span< T >::size_type n=1)
 Returns a span equal to in but with only the last n elements remaining.
 
unsigned long http_parser_version (void)
 
void http_parser_init (http_parser *parser, enum http_parser_type type)
 
void http_parser_settings_init (http_parser_settings *settings)
 
size_t http_parser_execute (http_parser *parser, const http_parser_settings *settings, const char *data, size_t len)
 
int http_should_keep_alive (const http_parser *parser)
 
const char * http_method_str (enum http_method m)
 
const char * http_status_str (enum http_status s)
 
const char * http_errno_name (enum http_errno err)
 
const char * http_errno_description (enum http_errno err)
 
void http_parser_url_init (struct http_parser_url *u)
 
int http_parser_parse_url (const char *buf, size_t buflen, int is_connect, struct http_parser_url *u)
 
void http_parser_pause (http_parser *parser, int paused)
 
int http_body_is_final (const http_parser *parser)
 
template<typename To , typename From , typename = std::enable_if_t<sizeof(To) == sizeof(From)>, typename = std::enable_if_t<std::is_trivially_constructible<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<From>::value>>
To bit_cast (const From &from) noexcept
 
template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
constexpr T byteswap (T V) noexcept
 Reverses the bytes in the given integer value V.
 
void vprint (wpi::raw_ostream &os, fmt::string_view format_str, fmt::format_args args)
 
template<typename S , typename... Args>
void print (wpi::raw_ostream &os, const S &format_str, Args &&... args)
 Prints formatted data to the stream os.
 
template<typename T , std::convertible_to< T >... Ts>
 array (T, Ts...) -> array< T, 1+sizeof...(Ts)>
 
template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
bool operator== (const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &RHS)
 Equality comparison for DenseMap.
 
template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
bool operator!= (const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &LHS, const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > &RHS)
 Inequality comparison for DenseMap.
 
template<typename KeyT , typename ValueT , typename KeyInfoT >
size_t capacity_in_bytes (const DenseMap< KeyT, ValueT, KeyInfoT > &X)
 
template<typename Char , size_t M>
 ct_string (Char const (&s)[M]) -> ct_string< Char, std::char_traits< Char >, M - 1 >
 
template<ct_string S>
constexpr auto operator""_ct_string ()
 
template<typename Char , typename Traits , size_t N1, size_t N2>
constexpr auto operator+ (ct_string< Char, Traits, N1 > const &s1, ct_string< Char, Traits, N2 > const &s2) noexcept
 
template<typename Char , typename Traits , size_t N1, size_t... N>
constexpr auto Concat (ct_string< Char, Traits, N1 > const &s1, ct_string< Char, Traits, N > const &... s)
 Concatenates multiple fixed_strings into a larger fixed_string at compile time.
 
template<intmax_t N, int Base = 10, typename Char = char, typename Traits = std::char_traits<Char>>
requires (Base >= 2 && Base <= 36)
constexpr auto NumToCtString ()
 Converts any integral to a ct_string at compile-time.
 
template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointee_iterator< WrappedIteratorT > > make_pointee_range (RangeT &&Range)
 
template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointer_iterator< WrappedIteratorT > > make_pointer_range (RangeT &&Range)
 
std::error_code mapLastWindowsError ()
 
std::error_code mapWindowsError (unsigned EV)
 
size_t Base64Decode (raw_ostream &os, std::string_view encoded)
 
size_t Base64Decode (std::string_view encoded, std::string *plain)
 
std::string_view Base64Decode (std::string_view encoded, size_t *num_read, SmallVectorImpl< char > &buf)
 
size_t Base64Decode (std::string_view encoded, std::vector< uint8_t > *plain)
 
std::span< uint8_t > Base64Decode (std::string_view encoded, size_t *num_read, SmallVectorImpl< uint8_t > &buf)
 
void Base64Encode (raw_ostream &os, std::string_view plain)
 
void Base64Encode (std::string_view plain, std::string *encoded)
 
std::string_view Base64Encode (std::string_view plain, SmallVectorImpl< char > &buf)
 
void Base64Encode (raw_ostream &os, std::span< const uint8_t > plain)
 
void Base64Encode (std::span< const uint8_t > plain, std::string *encoded)
 
std::string_view Base64Encode (std::span< const uint8_t > plain, SmallVectorImpl< char > &buf)
 
void install_fatal_error_handler (fatal_error_handler_t handler, void *user_data=nullptr)
 install_fatal_error_handler - Installs a new error handler to be used whenever a serious (non-recoverable) error is encountered by LLVM.
 
void remove_fatal_error_handler ()
 Restores default error handling behaviour.
 
void report_fatal_error (const char *reason, bool gen_crash_diag=true)
 Reports a serious error, calling any installed error handler.
 
void report_fatal_error (const std::string &reason, bool gen_crash_diag=true)
 
void report_fatal_error (std::string_view reason, bool gen_crash_diag=true)
 
void install_bad_alloc_error_handler (fatal_error_handler_t handler, void *user_data=nullptr)
 Installs a new bad alloc error handler that should be used whenever a bad alloc error, e.g.
 
void remove_bad_alloc_error_handler ()
 Restores default bad alloc error handling behavior.
 
void install_out_of_memory_new_handler ()
 
void report_bad_alloc_error (const char *Reason, bool GenCrashDiag=true)
 Reports a bad alloc error, calling any user defined bad alloc error handler.
 
void wpi_unreachable_internal (const char *msg=nullptr, const char *file=nullptr, unsigned line=0)
 This function calls abort(), and prints the optional message to stderr.
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
UnpackStruct (std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct.
 
template<typename T , size_t Offset, typename... I>
requires StructSerializable<T, I...>
UnpackStruct (std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct starting at a given offset within the data.
 
template<StructSerializable T, size_t Offset, size_t N>
wpi::array< T, N > UnpackStructArray (std::span< const uint8_t > data)
 Unpack a serialized struct array starting at a given offset within the data.
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
void PackStruct (std::span< uint8_t > data, T &&value, const I &... info)
 Pack a serialized struct.
 
template<size_t Offset, typename T , typename... I>
requires StructSerializable<T, I...>
void PackStruct (std::span< uint8_t > data, T &&value, const I &... info)
 Pack a serialized struct starting at a given offset within the data.
 
template<size_t Offset, size_t N, StructSerializable T>
void PackStructArray (std::span< uint8_t > data, const wpi::array< T, N > &arr)
 Pack a serialized struct array starting at a given offset within the data.
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
void UnpackStructInto (T *out, std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct into an existing object, overwriting its contents.
 
template<size_t Offset, typename T , typename... I>
requires StructSerializable<T, I...>
void UnpackStructInto (T *out, std::span< const uint8_t > data, const I &... info)
 Unpack a serialized struct into an existing object, overwriting its contents, and starting at a given offset within the data.
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
constexpr auto GetStructTypeName (const I &... info)
 Get the type name for a raw struct serializable type.
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
constexpr auto GetStructTypeString (const I &... info)
 Get the type string for a raw struct serializable type.
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
constexpr size_t GetStructSize (const I &... info)
 Get the size for a raw struct serializable type.
 
template<typename T , size_t N, typename... I>
requires StructSerializable<T, I...>
constexpr auto MakeStructArrayTypeName (const I &... info)
 
template<typename T , size_t N, typename... I>
requires StructSerializable<T, I...>
constexpr auto MakeStructArrayTypeString (const I &... info)
 
template<typename T , size_t N, typename... I>
requires StructSerializable<T, I...>
constexpr auto MakeStructArraySchema (const I &... info)
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
constexpr std::string_view GetStructSchema (const I &... info)
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
constexpr std::span< const uint8_t > GetStructSchemaBytes (const I &... info)
 
template<typename T , typename... I>
requires StructSerializable<T, I...>
void ForEachStructSchema (std::invocable< std::string_view, std::string_view > auto fn, const I &... info)
 
std::error_code make_error_code (errc E)
 
raw_ostreamoperator<< (raw_ostream &OS, sys::TimePoint<> TP)
 
raw_ostreamoperator<< (raw_ostream &OS, sys::UtcTime<> TP)
 
template<typename... T>
void print (fmt::format_string< T... > fmt, T &&... args)
 Wrapper around fmt::print() that squelches write failure exceptions.
 
template<typename... T>
void print (std::FILE *f, fmt::format_string< T... > fmt, T &&... args)
 Wrapper around fmt::print() that squelches write failure exceptions.
 
template<typename... T>
void println (fmt::format_string< T... > fmt, T &&... args)
 Wrapper around fmt::println() that squelches write failure exceptions.
 
template<typename... T>
void println (std::FILE *f, fmt::format_string< T... > fmt, T &&... args)
 Wrapper around fmt::println() that squelches write failure exceptions.
 
template<typename PtrType >
bool operator== (const SmallPtrSetImpl< PtrType > &LHS, const SmallPtrSetImpl< PtrType > &RHS)
 Equality comparison for SmallPtrSet.
 
template<typename PtrType >
bool operator!= (const SmallPtrSetImpl< PtrType > &LHS, const SmallPtrSetImpl< PtrType > &RHS)
 Inequality comparison for SmallPtrSet.
 
uint64_t NowDefault ()
 The default implementation used for Now().
 
void SetNowImpl (uint64_t(*func)())
 Set the implementation used by Now().
 
uint64_t Now ()
 Return a value representing the current time in microseconds.
 
uint64_t GetSystemTime ()
 Return the current system time in microseconds since the Unix epoch (January 1st, 1970 00:00 UTC).
 
template<typename RangeT >
constexpr auto adl_begin (RangeT &&range) -> decltype(adl_detail::begin_impl(std::forward< RangeT >(range)))
 Returns the begin iterator to range using std::begin and function found through Argument-Dependent Lookup (ADL).
 
template<typename RangeT >
constexpr auto adl_end (RangeT &&range) -> decltype(adl_detail::end_impl(std::forward< RangeT >(range)))
 Returns the end iterator to range using std::end and functions found through Argument-Dependent Lookup (ADL).
 
template<typename RangeT >
constexpr auto adl_rbegin (RangeT &&range) -> decltype(adl_detail::rbegin_impl(std::forward< RangeT >(range)))
 Returns the reverse-begin iterator to range using std::rbegin and function found through Argument-Dependent Lookup (ADL).
 
template<typename RangeT >
constexpr auto adl_rend (RangeT &&range) -> decltype(adl_detail::rend_impl(std::forward< RangeT >(range)))
 Returns the reverse-end iterator to range using std::rend and functions found through Argument-Dependent Lookup (ADL).
 
template<typename T >
constexpr void adl_swap (T &&lhs, T &&rhs) noexcept(noexcept(adl_detail::swap_impl(std::declval< T >(), std::declval< T >())))
 Swaps lhs with rhs using std::swap and functions found through Argument-Dependent Lookup (ADL).
 
template<typename RangeT >
constexpr auto adl_size (RangeT &&range) -> decltype(adl_detail::size_impl(std::forward< RangeT >(range)))
 Returns the size of range using std::size and functions found through Argument-Dependent Lookup (ADL).
 
template<class Lambda , int = (Lambda{}(), 0)>
constexpr bool is_constexpr (Lambda)
 
constexpr bool is_constexpr (...)
 
constexpr std::string_view to_string_view (const struct WPI_String *str)
 Converts a WPI_String to a string_view.
 
constexpr WPI_String make_string (std::string_view view)
 Converts a string_view to a WPI_String.
 
std::string GetHostname ()
 
std::string_view GetHostname (SmallVectorImpl< char > &name)
 
template<class E >
constexpr bool operator== (const unexpected< E > &lhs, const unexpected< E > &rhs)
 
template<class E >
constexpr bool operator!= (const unexpected< E > &lhs, const unexpected< E > &rhs)
 
template<class E >
constexpr bool operator< (const unexpected< E > &lhs, const unexpected< E > &rhs)
 
template<class E >
constexpr bool operator<= (const unexpected< E > &lhs, const unexpected< E > &rhs)
 
template<class E >
constexpr bool operator> (const unexpected< E > &lhs, const unexpected< E > &rhs)
 
template<class E >
constexpr bool operator>= (const unexpected< E > &lhs, const unexpected< E > &rhs)
 
template<class E >
unexpected< typename std::decay< E >::type > make_unexpected (E &&e)
 
template<class T , class E , class U , class F >
constexpr bool operator== (const expected< T, E > &lhs, const expected< U, F > &rhs)
 
template<class T , class E , class U , class F >
constexpr bool operator!= (const expected< T, E > &lhs, const expected< U, F > &rhs)
 
template<class E , class F >
constexpr bool operator== (const expected< void, E > &lhs, const expected< void, F > &rhs)
 
template<class E , class F >
constexpr bool operator!= (const expected< void, E > &lhs, const expected< void, F > &rhs)
 
template<class T , class E , class U >
constexpr bool operator== (const expected< T, E > &x, const U &v)
 
template<class T , class E , class U >
constexpr bool operator== (const U &v, const expected< T, E > &x)
 
template<class T , class E , class U >
constexpr bool operator!= (const expected< T, E > &x, const U &v)
 
template<class T , class E , class U >
constexpr bool operator!= (const U &v, const expected< T, E > &x)
 
template<class T , class E >
constexpr bool operator== (const expected< T, E > &x, const unexpected< E > &e)
 
template<class T , class E >
constexpr bool operator== (const unexpected< E > &e, const expected< T, E > &x)
 
template<class T , class E >
constexpr bool operator!= (const expected< T, E > &x, const unexpected< E > &e)
 
template<class T , class E >
constexpr bool operator!= (const unexpected< E > &e, const expected< T, E > &x)
 
template<class T , class E , detail_expected::enable_if_t<(std::is_void< T >::value||std::is_move_constructible< T >::value) &&detail_expected::is_swappable< T >::value &&std::is_move_constructible< E >::value &&detail_expected::is_swappable< E >::value > * = nullptr>
void swap (expected< T, E > &lhs, expected< T, E > &rhs) noexcept(noexcept(lhs.swap(rhs)))
 
std::string_view UnescapeURI (std::string_view str, SmallVectorImpl< char > &buf, bool *error)
 
std::string_view EscapeURI (std::string_view str, SmallVectorImpl< char > &buf, bool spacePlus=true)
 
std::string_view EscapeHTML (std::string_view str, SmallVectorImpl< char > &buf)
 
bool ParseHttpHeaders (raw_istream &is, SmallVectorImpl< char > *contentType, SmallVectorImpl< char > *contentLength)
 
bool FindMultipartBoundary (wpi::raw_istream &is, std::string_view boundary, std::string *saveBuf)
 
ConversionResult ConvertUTF8toUTF16 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF8toUTF32Partial (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 Convert a partial UTF8 sequence to UTF32.
 
ConversionResult ConvertUTF8toUTF32 (const UTF8 **sourceStart, const UTF8 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 Convert a partial UTF8 sequence to UTF32.
 
ConversionResult ConvertUTF16toUTF8 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF32toUTF8 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF8 **targetStart, UTF8 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF16toUTF32 (const UTF16 **sourceStart, const UTF16 *sourceEnd, UTF32 **targetStart, UTF32 *targetEnd, ConversionFlags flags)
 
ConversionResult ConvertUTF32toUTF16 (const UTF32 **sourceStart, const UTF32 *sourceEnd, UTF16 **targetStart, UTF16 *targetEnd, ConversionFlags flags)
 
Boolean isLegalUTF8Sequence (const UTF8 *source, const UTF8 *sourceEnd)
 
Boolean isLegalUTF8String (const UTF8 **source, const UTF8 *sourceEnd)
 
unsigned getUTF8SequenceSize (const UTF8 *source, const UTF8 *sourceEnd)
 
unsigned getNumBytesForUTF8 (UTF8 firstByte)
 
bool ConvertUTF8toWide (unsigned WideCharWidth, std::string_view Source, char *&ResultPtr, const UTF8 *&ErrorPtr)
 Convert an UTF8 string_view to UTF8, UTF16, or UTF32 depending on WideCharWidth.
 
bool ConvertUTF8toWide (std::string_view Source, std::wstring &Result)
 Converts a UTF-8 string_view to a std::wstring.
 
bool ConvertUTF8toWide (const char *Source, std::wstring &Result)
 Converts a UTF-8 C-string to a std::wstring.
 
bool convertWideToUTF8 (const std::wstring &Source, SmallVectorImpl< char > &Result)
 Converts a std::wstring to a UTF-8 encoded std::string.
 
bool ConvertCodePointToUTF8 (unsigned Source, char *&ResultPtr)
 Convert an Unicode code point to UTF8 sequence.
 
ConversionResult convertUTF8Sequence (const UTF8 **source, const UTF8 *sourceEnd, UTF32 *target, ConversionFlags flags)
 Convert the first UTF8 sequence in the given source buffer to a UTF32 code point.
 
bool hasUTF16ByteOrderMark (std::span< const char > SrcBytes)
 Returns true if a blob of text starts with a UTF-16 big or little endian byte order mark.
 
bool convertUTF16ToUTF8String (std::span< const char > SrcBytes, SmallVectorImpl< char > &Out)
 Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.
 
bool convertUTF16ToUTF8String (std::span< const UTF16 > Src, SmallVectorImpl< char > &Out)
 Converts a UTF16 string into a UTF8 std::string.
 
bool convertUTF32ToUTF8String (std::span< const char > SrcBytes, std::string &Out)
 Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string.
 
bool convertUTF32ToUTF8String (std::span< const UTF32 > Src, std::string &Out)
 Converts a UTF32 string into a UTF8 std::string.
 
bool convertUTF8ToUTF16String (std::string_view SrcUTF8, SmallVectorImpl< UTF16 > &DstUTF16)
 Converts a UTF-8 string into a UTF-16 string with native endianness.
 
constexpr char hexdigit (unsigned X, bool LowerCase=false) noexcept
 hexdigit - Return the hexadecimal character for the given number X (which should be less than 16).
 
constexpr unsigned hexDigitValue (char C) noexcept
 Interpret the given character C as a hexadecimal digit and return its value.
 
constexpr bool isDigit (char C) noexcept
 Checks if character C is one of the 10 decimal digits.
 
constexpr bool isHexDigit (char C) noexcept
 Checks if character C is a hexadecimal numeric character.
 
constexpr bool isAlpha (char C) noexcept
 Checks if character C is a valid letter as classified by "C" locale.
 
constexpr bool isAlnum (char C) noexcept
 Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classified by "C" locale.
 
constexpr bool isASCII (char C) noexcept
 Checks whether character C is valid ASCII (high bit is zero).
 
constexpr bool isPrint (char C) noexcept
 Checks whether character C is printable.
 
constexpr char toLower (char x) noexcept
 Returns the corresponding lowercase character if x is uppercase.
 
constexpr char toUpper (char x) noexcept
 Returns the corresponding uppercase character if x is lowercase.
 
std::string utohexstr (unsigned long long val, bool lowerCase=false)
 
constexpr bool equals (std::string_view lhs, std::string_view rhs) noexcept
 equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.
 
int compare_lower (std::string_view lhs, std::string_view rhs) noexcept
 compare_lower - Compare two strings, ignoring case.
 
constexpr bool equals_lower (std::string_view lhs, std::string_view rhs) noexcept
 equals_lower - Check for string equality, ignoring case.
 
std::string_view::size_type find_lower (std::string_view str, char ch, std::string_view::size_type from=0) noexcept
 Search for the first character ch in str, ignoring case.
 
std::string_view::size_type find_lower (std::string_view str, std::string_view other, std::string_view::size_type from=0) noexcept
 Search for the first string other in str, ignoring case.
 
std::string_view::size_type find_lower (std::string_view str, const char *other, std::string_view::size_type from=0) noexcept
 Search for the first string other in str, ignoring case.
 
std::string_view::size_type rfind_lower (std::string_view str, char ch, std::string_view::size_type from=std::string_view::npos) noexcept
 Search for the last character ch in str, ignoring case.
 
std::string_view::size_type rfind_lower (std::string_view str, std::string_view other) noexcept
 Search for the last string other in str, ignoring case.
 
std::string_view::size_type rfind_lower (std::string_view str, const char *other) noexcept
 Search for the last string other in str, ignoring case.
 
constexpr std::string_view substr (std::string_view str, std::string_view::size_type start, std::string_view::size_type n=std::string_view::npos) noexcept
 Returns the substring of str from [start, start + n).
 
constexpr bool starts_with (std::string_view str, std::string_view prefix) noexcept
 Checks if str starts with the given prefix.
 
constexpr bool starts_with (std::string_view str, char prefix) noexcept
 Checks if str starts with the given prefix.
 
constexpr bool starts_with (std::string_view str, const char *prefix) noexcept
 Checks if str starts with the given prefix.
 
bool starts_with_lower (std::string_view str, std::string_view prefix) noexcept
 Checks if str starts with the given prefix, ignoring case.
 
constexpr bool starts_with_lower (std::string_view str, char prefix) noexcept
 Checks if str starts with the given prefix, ignoring case.
 
bool starts_with_lower (std::string_view str, const char *prefix) noexcept
 Checks if str starts with the given prefix, ignoring case.
 
constexpr bool ends_with (std::string_view str, std::string_view suffix) noexcept
 Checks if str ends with the given suffix.
 
constexpr bool ends_with (std::string_view str, char suffix) noexcept
 Checks if str ends with the given suffix.
 
constexpr bool ends_with (std::string_view str, const char *suffix) noexcept
 Checks if str ends with the given suffix.
 
bool ends_with_lower (std::string_view str, std::string_view suffix) noexcept
 Checks if str ends with the given suffix, ignoring case.
 
constexpr bool ends_with_lower (std::string_view str, char suffix) noexcept
 Checks if str ends with the given suffix, ignoring case.
 
bool ends_with_lower (std::string_view str, const char *suffix) noexcept
 Checks if str ends with the given suffix, ignoring case.
 
constexpr bool contains (std::string_view str, std::string_view other) noexcept
 Checks if str contains the substring other.
 
constexpr bool contains (std::string_view str, char ch) noexcept
 Checks if str contains the substring other.
 
constexpr bool contains (std::string_view str, const char *other) noexcept
 Checks if str contains the substring other.
 
bool contains_lower (std::string_view str, std::string_view other) noexcept
 Checks if str contains the substring other, ignoring case.
 
bool contains_lower (std::string_view str, char ch) noexcept
 Checks if str contains the substring other, ignoring case.
 
bool contains_lower (std::string_view str, const char *other) noexcept
 Checks if str contains the substring other, ignoring case.
 
constexpr std::optional< std::string_view > remove_prefix (std::string_view str, std::string_view prefix) noexcept
 Return an optional containing str but with prefix removed if the string starts with the prefix.
 
constexpr std::optional< std::string_view > remove_suffix (std::string_view str, std::string_view suffix) noexcept
 Return an optional containing str but with suffix removed if the string ends with the suffix.
 
constexpr std::string_view drop_front (std::string_view str, std::string_view::size_type n=1) noexcept
 Return a string_view equal to str but with the first n elements dropped.
 
constexpr std::string_view drop_back (std::string_view str, std::string_view::size_type n=1) noexcept
 Return a string_view equal to str but with the last n elements dropped.
 
constexpr std::string_view take_front (std::string_view str, std::string_view::size_type n=1) noexcept
 Returns a view equal to str but with only the first n elements remaining.
 
constexpr std::string_view take_back (std::string_view str, std::string_view::size_type n=1) noexcept
 Returns a view equal to str but with only the last n elements remaining.
 
constexpr std::string_view slice (std::string_view str, std::string_view::size_type start, std::string_view::size_type end) noexcept
 Returns a reference to the substring of str from [start, end).
 
constexpr std::pair< std::string_view, std::string_view > split (std::string_view str, char separator) noexcept
 Splits str into two substrings around the first occurrence of a separator character.
 
constexpr std::pair< std::string_view, std::string_view > split (std::string_view str, std::string_view separator) noexcept
 Splits str into two substrings around the first occurrence of a separator string.
 
constexpr std::pair< std::string_view, std::string_view > rsplit (std::string_view str, char separator) noexcept
 Splits str into two substrings around the last occurrence of a separator character.
 
constexpr std::pair< std::string_view, std::string_view > rsplit (std::string_view str, std::string_view separator) noexcept
 Splits str into two substrings around the last occurrence of a separator string.
 
void split (std::string_view str, SmallVectorImpl< std::string_view > &arr, std::string_view separator, int maxSplit=-1, bool keepEmpty=true) noexcept
 Splits str into substrings around the occurrences of a separator string.
 
void split (std::string_view str, SmallVectorImpl< std::string_view > &arr, char separator, int maxSplit=-1, bool keepEmpty=true) noexcept
 Splits str into substrings around the occurrences of a separator character.
 
constexpr std::string_view ltrim (std::string_view str, char ch) noexcept
 Returns str with consecutive ch characters starting from the the left removed.
 
constexpr std::string_view ltrim (std::string_view str, std::string_view chars=" \t\n\v\f\r") noexcept
 Returns str with consecutive characters in chars starting from the left removed.
 
constexpr std::string_view rtrim (std::string_view str, char ch) noexcept
 Returns str with consecutive Char characters starting from the right removed.
 
constexpr std::string_view rtrim (std::string_view str, std::string_view chars=" \t\n\v\f\r") noexcept
 Returns str with consecutive characters in chars starting from the right removed.
 
constexpr std::string_view trim (std::string_view str, char ch) noexcept
 Returns str with consecutive ch characters starting from the left and right removed.
 
constexpr std::string_view trim (std::string_view str, std::string_view chars=" \t\n\v\f\r") noexcept
 Returns str with consecutive characters in chars starting from the left and right removed.
 
template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true>
std::optional< T > parse_integer (std::string_view str, unsigned radix) noexcept
 Parses the string str as an integer of the specified radix.
 
template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true>
std::optional< T > consume_integer (std::string_view *str, unsigned radix) noexcept
 Parses the string str as an integer of the specified radix.
 
template<typename T >
std::optional< T > parse_float (std::string_view str) noexcept
 Parses the string str as a floating point value.
 
template<>
std::optional< float > parse_float< float > (std::string_view str) noexcept
 
template<>
std::optional< double > parse_float< double > (std::string_view str) noexcept
 
template<>
std::optional< long double > parse_float< long double > (std::string_view str) noexcept
 
std::pair< std::string_view, std::string_view > UnescapeCString (std::string_view str, SmallVectorImpl< char > &buf)
 Unescapes a C-style string (reverse operation to raw_ostream::write_escaped).
 
template<class OutputIt , class... Args>
void format_to_n_c_str (OutputIt out, std::iter_difference_t< OutputIt > n, fmt::format_string< Args... > fmt, Args &&... args)
 Like std::format_to_n() in that it writes at most n bytes to the output buffer, but also includes a terminating null byte in n.
 
template<typename OStream , typename T >
std::enable_if_t<!std::is_reference_v< OStream > &&std::is_base_of_v< raw_ostream, OStream >, OStream && > operator<< (OStream &&OS, const T &Value)
 Call the appropriate insertion operator, given an rvalue reference to a raw_ostream object and return a stream of the same type as the argument.
 
raw_fd_ostreamouts ()
 This returns a reference to a raw_fd_ostream for standard output.
 
raw_fd_ostreamerrs ()
 This returns a reference to a raw_ostream for standard error.
 
raw_ostreamnulls ()
 This returns a reference to a raw_ostream which simply discards output.
 
std::string GetStackTrace (int offset)
 Get a stack trace, ignoring the first "offset" symbols.
 
std::string GetStackTraceDefault (int offset)
 The default implementation used for GetStackTrace().
 
void SetGetStackTraceImpl (std::string(*func)(int offset))
 Set the implementation used by GetStackTrace().
 
uint64_t SizeUleb128 (uint64_t val)
 Get size of unsigned LEB128 data.
 
uint64_t WriteUleb128 (SmallVectorImpl< char > &dest, uint64_t val)
 Write unsigned LEB128 data.
 
void WriteUleb128 (raw_ostream &os, uint64_t val)
 Write unsigned LEB128 data.
 
uint64_t ReadUleb128 (const char *addr, uint64_t *ret)
 Read unsigned LEB128 data.
 
bool ReadUleb128 (raw_istream &is, uint64_t *ret)
 Read unsigned LEB128 data from a stream.
 
template<typename T , unsigned N>
size_t capacity_in_bytes (const SmallVector< T, N > &X)
 
template<unsigned Size, typename R >
SmallVector< ValueTypeFromRangeType< R >, Size > to_vector (R &&Range)
 Given a range of type R, iterate the entire range and return a SmallVector with elements of the vector.
 
template<typename R >
SmallVector< ValueTypeFromRangeType< R > > to_vector (R &&Range)
 
template<typename Out , unsigned Size, typename R >
SmallVector< Out, Size > to_vector_of (R &&Range)
 
template<typename Out , typename R >
SmallVector< Out > to_vector_of (R &&Range)
 
template<typename T , typename Pred >
SmallVectorImpl< T >::size_type erase_if (SmallVectorImpl< T > &c, Pred pred)
 
template<typename T >
std::vector< T >::iterator insert_sorted (std::vector< T > &vec, T const &item)
 
template<typename F , typename... Ts>
constexpr void for_each (F &&f, Ts &&... elems)
 Calls f(i, elem) for each element of elems where i is the index of the element in elems and elem is the element.
 
template<typename T , typename Function >
auto transformOptional (const std::optional< T > &O, const Function &F) -> std::optional< decltype(F(*O))>
 
template<typename T , typename Function >
auto transformOptional (std::optional< T > &&O, const Function &F) -> std::optional< decltype(F(*std::move(O)))>
 
template<typename Enum >
constexpr std::underlying_type_t< Enum > to_underlying (Enum E)
 Returns underlying integer value of an enum.
 
template<typename T >
T * CreateMessage (google::protobuf::Arena *arena)
 
template<typename T , unsigned LN, unsigned RN, typename C >
bool operator== (const SmallSet< T, LN, C > &LHS, const SmallSet< T, RN, C > &RHS)
 Equality comparison for SmallSet.
 
template<typename T , unsigned LN, unsigned RN, typename C >
bool operator!= (const SmallSet< T, LN, C > &LHS, const SmallSet< T, RN, C > &RHS)
 Inequality comparison for SmallSet.
 
template<typename ... PTs>
bool operator== (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<typename ... PTs>
bool operator!= (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<typename ... PTs>
bool operator< (PointerUnion< PTs... > lhs, PointerUnion< PTs... > rhs)
 
template<class T = void *>
bool shouldReverseIterate ()
 
template<typename T >
std::enable_if_t< is_integral_or_enum< T >::value, hash_codehash_value (T value)
 Compute a hash_code for any integer value.
 
template<typename T >
hash_code hash_value (const T *ptr)
 Compute a hash_code for a pointer's address.
 
template<typename T , typename U >
hash_code hash_value (const std::pair< T, U > &arg)
 Compute a hash_code for a pair of objects.
 
template<typename... Ts>
hash_code hash_value (const std::tuple< Ts... > &arg)
 Compute a hash_code for a tuple.
 
template<typename T >
hash_code hash_value (const std::basic_string< T > &arg)
 Compute a hash_code for a standard string.
 
template<typename T >
hash_code hash_value (const std::optional< T > &arg)
 Compute a hash_code for a standard string.
 
template<typename InputIteratorT >
hash_code hash_combine_range (InputIteratorT first, InputIteratorT last)
 Compute a hash_code for a sequence of values.
 
template<typename ... Ts>
hash_code hash_combine (const Ts &...args)
 Combine values into a single hash_code.
 
WPI_EventHandle CreateEvent (bool manualReset=false, bool initialState=false)
 Creates an event.
 
void DestroyEvent (WPI_EventHandle handle)
 Destroys an event.
 
void SetEvent (WPI_EventHandle handle)
 Sets an event to signaled state.
 
void ResetEvent (WPI_EventHandle handle)
 Sets an event to non-signaled state.
 
WPI_SemaphoreHandle CreateSemaphore (int initialCount=0, int maximumCount=INT_MAX)
 Creates a semaphore.
 
void DestroySemaphore (WPI_SemaphoreHandle handle)
 Destroys a semaphore.
 
bool ReleaseSemaphore (WPI_SemaphoreHandle handle, int releaseCount=1, int *prevCount=nullptr)
 Releases N counts of a semaphore.
 
bool WaitForObject (WPI_Handle handle)
 Waits for an handle to be signaled.
 
bool WaitForObject (WPI_Handle handle, double timeout, bool *timedOut)
 Waits for an handle to be signaled, with timeout.
 
std::span< WPI_HandleWaitForObjects (std::span< const WPI_Handle > handles, std::span< WPI_Handle > signaled)
 Waits for one or more handles to be signaled.
 
std::span< WPI_HandleWaitForObjects (std::initializer_list< WPI_Handle > handles, std::span< WPI_Handle > signaled)
 Waits for one or more handles to be signaled.
 
std::span< WPI_HandleWaitForObjects (std::span< const WPI_Handle > handles, std::span< WPI_Handle > signaled, double timeout, bool *timedOut)
 Waits for one or more handles to be signaled, with timeout.
 
std::span< WPI_HandleWaitForObjects (std::initializer_list< WPI_Handle > handles, std::span< WPI_Handle > signaled, double timeout, bool *timedOut)
 Waits for one or more handles to be signaled, with timeout.
 
void CreateSignalObject (WPI_Handle handle, bool manualReset=false, bool initialState=false)
 Sets up signaling for an arbitrary handle.
 
void SetSignalObject (WPI_Handle handle)
 Sets a handle to signaled state.
 
void ResetSignalObject (WPI_Handle handle)
 Sets a handle to non-signaled state.
 
void DestroySignalObject (WPI_Handle handle)
 Cleans up signaling for a handle.
 
template<typename T >
future< T > make_ready_future (T &&value)
 Constructs a valid future with the value set.
 
future< void > make_ready_future ()
 Constructs a valid future with the value set.
 
std::string_view MimeTypeFromPath (std::string_view path)
 
default_arguments operator& (const default_arguments &a, const default_arguments &b)
 
template<typename Type , size_t ArrayExtent>
 rotated_span (Type(&)[ArrayExtent]) -> rotated_span< Type, ArrayExtent >
 
template<typename Type , size_t ArrayExtent>
 rotated_span (std::array< Type, ArrayExtent > &) -> rotated_span< Type, ArrayExtent >
 
template<std::contiguous_iterator It, typename End >
 rotated_span (It, End) -> rotated_span< std::remove_reference_t< std::iter_reference_t< It > > >
 
template<typename Type , size_t Extent>
rotated_span< const std::byte, Extent==std::dynamic_extent ? std::dynamic_extent :Extent *sizeof(Type)> as_bytes (rotated_span< Type, Extent > sp) noexcept
 
template<typename Type , size_t Extent>
requires (!std::is_const_v<Type>)
rotated_span< std::byte, Extent==std::dynamic_extent ? std::dynamic_extent :Extent *sizeof(Type)> as_writable_bytes (rotated_span< Type, Extent > sp) noexcept
 
uint64_t xxHash64 (std::string_view Data)
 
uint64_t xxHash64 (std::span< const uint8_t > Data)
 
uint64_t xxh3_64bits (std::span< const uint8_t > data)
 
uint64_t xxh3_64bits (std::string_view data)
 
XXH128_hash_t xxh3_128bits (std::span< const uint8_t > data)
 XXH3's 128-bit variant.
 
bool is_debugger_present () noexcept
 
void breakpoint () noexcept
 
void breakpoint_if_debugging () noexcept
 
template<typename Container >
 iterator_range (Container &&) -> iterator_range< wpi::detail::IterOfRange< Container > >
 
template<class T >
iterator_range< T > make_range (T x, T y)
 Convenience function for iterating over sub-ranges.
 
template<typename T >
iterator_range< T > make_range (std::pair< T, T > p)
 

Variables

template<typename T >
constexpr bool IsNullable
 
template<typename... Types>
constexpr detail::IsaCheckPredicate< Types... > IsaPred {}
 Function object wrapper for the wpi::isa type check.
 
template<typename... Types>
constexpr detail::IsaAndPresentCheckPredicate< Types... > IsaAndPresentPred {}
 Function object wrapper for the wpi::isa_and_present type check.
 
static const unsigned char BitReverseTable256 [256]
 Macro compressed bit reversal table for 256 bits.
 
const float huge_valf
 Use this rather than HUGE_VALF; the latter causes warnings on MSVC.
 
constexpr empty_array_t empty_array
 
static constexpr in_place_t in_place {}
 
static constexpr unexpect_t unexpect {}
 
template<typename T , unsigned N>
class LLVM_GSL_OWNER SmallVector
 Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>).
 
constexpr unsigned int kInvalidHandle = 0
 Constant representing an invalid handle.
 
constexpr int kHandleTypeEvent = 1
 Standard types for handles.
 
constexpr int kHandleTypeSemaphore = 2
 
constexpr int kHandleTypeCSBase = 3
 
constexpr int kHandleTypeNTBase = 16
 
constexpr int kHandleTypeHALBase = 48
 
constexpr int kHandleTypeUserBase = 80
 

Detailed Description

Foonathan namespace.

Typedef Documentation

◆ Boolean

typedef bool wpi::Boolean

◆ common_sint

template<typename T , typename U , typename = enableif_int<T, U>>
using wpi::common_sint
Initial value:
std::common_type_t<std::make_signed_t<T>, std::make_signed_t<U>>

◆ common_uint

template<typename T , typename U , typename = enableif_int<T, U>>
using wpi::common_uint
Initial value:
std::common_type_t<std::make_unsigned_t<T>, std::make_unsigned_t<U>>

◆ condition_variable

using wpi::condition_variable = ::std::condition_variable

◆ enableif_int

template<typename T , typename U >
using wpi::enableif_int
Initial value:
std::enable_if_t<std::is_integral_v<T> && std::is_integral_v<U>>

Some template parameter helpers to optimize for bitwidth, for functions that take multiple arguments.

◆ EnableIfConvertibleToInputIterator

template<class Iterator >
using wpi::EnableIfConvertibleToInputIterator
Initial value:
std::enable_if_t<std::is_convertible<
typename std::iterator_traits<Iterator>::iterator_category,
std::input_iterator_tag>::value>

◆ fatal_error_handler_t

typedef void(* wpi::fatal_error_handler_t) (void *user_data, const char *reason, bool gen_crash_diag)

An error handler callback.

◆ http_cb

typedef int(* wpi::http_cb) (http_parser *)

◆ http_data_cb

typedef int(* wpi::http_data_cb) (http_parser *, const char *at, size_t length)

◆ mutex

using wpi::mutex = ::std::mutex

◆ raw_pointer_iterator

template<typename WrappedIteratorT , typename T1 = std::remove_reference_t<decltype( **std::declval<WrappedIteratorT>())>, typename T2 = std::add_pointer_t<T1>>
using wpi::raw_pointer_iterator
Initial value:
pointer_iterator<pointee_iterator<WrappedIteratorT, T1>, T2>

◆ recursive_mutex

using wpi::recursive_mutex = ::std::recursive_mutex

◆ recursive_spinlock

◆ stack_float_t

using wpi::stack_float_t = float

Type to force float point values onto the stack, so that x86 doesn't add hidden precision, avoiding rounding differences on various platforms.

◆ TypeAtIndex

template<size_t I, typename... Ts>
using wpi::TypeAtIndex = std::tuple_element_t<I, std::tuple<Ts...>>

Find the type at a given index in a list of types.

TypeAtIndex<I, Ts...> is the type at index I in Ts.

◆ UTF16

typedef unsigned short wpi::UTF16

◆ UTF32

typedef unsigned int wpi::UTF32

◆ UTF8

typedef unsigned char wpi::UTF8

◆ ValueTypeFromRangeType

template<typename RangeType >
using wpi::ValueTypeFromRangeType
Initial value:
std::remove_const_t<std::remove_reference_t<decltype(*std::begin(
std::declval<RangeType &>()))>>

Enumeration Type Documentation

◆ ConversionFlags

Enumerator
strictConversion 
lenientConversion 

◆ ConversionResult

Enumerator
conversionOK 
sourceExhausted 
targetExhausted 
sourceIllegal 

◆ DecodeLimits

enum class wpi::DecodeLimits
strong

The behavior to use when more elements are in the message then expected when decoding.

Enumerator
Ignore 
Add 
Fail 

◆ default_arguments

enum class wpi::default_arguments : unsigned int
strong
Enumerator
none 
help 
version 
all 

◆ endianness

enum class wpi::endianness
strong
Enumerator
big 
little 
native 

◆ errc

enum class wpi::errc
strong
Enumerator
argument_list_too_long 
argument_out_of_domain 
bad_address 
bad_file_descriptor 
broken_pipe 
delete_pending 
device_or_resource_busy 
directory_not_empty 
executable_format_error 
file_exists 
file_too_large 
filename_too_long 
function_not_supported 
illegal_byte_sequence 
inappropriate_io_control_operation 
interrupted 
invalid_argument 
invalid_seek 
io_error 
is_a_directory 
no_child_process 
no_lock_available 
no_space_on_device 
no_such_device_or_address 
no_such_device 
no_such_file_or_directory 
no_such_process 
not_a_directory 
not_enough_memory 
not_supported 
operation_not_permitted 
permission_denied 
read_only_file_system 
resource_deadlock_would_occur 
resource_unavailable_try_again 
result_out_of_range 
too_many_files_open_in_system 
too_many_files_open 
too_many_links 

◆ flags

enum wpi::flags
Enumerator
F_CHUNKED 
F_CONNECTION_KEEP_ALIVE 
F_CONNECTION_CLOSE 
F_CONNECTION_UPGRADE 
F_TRAILING 
F_UPGRADE 
F_SKIPBODY 
F_CONTENTLENGTH 

◆ http_errno

◆ http_method

◆ http_parser_type

Enumerator
HTTP_REQUEST 
HTTP_RESPONSE 
HTTP_BOTH 

◆ http_parser_url_fields

Enumerator
UF_SCHEMA 
UF_HOST 
UF_PORT 
UF_PATH 
UF_QUERY 
UF_FRAGMENT 
UF_USERINFO 
UF_MAX 

◆ http_status

◆ LogLevel

Enumerator
WPI_LOG_CRITICAL 
WPI_LOG_ERROR 
WPI_LOG_WARNING 
WPI_LOG_INFO 
WPI_LOG_DEBUG 
WPI_LOG_DEBUG1 
WPI_LOG_DEBUG2 
WPI_LOG_DEBUG3 
WPI_LOG_DEBUG4 

◆ nargs_pattern

enum class wpi::nargs_pattern
strong
Enumerator
optional 
any 
at_least_one 

◆ StructFieldType

enum class wpi::StructFieldType
strong

Known data types for raw struct dynamic fields (see StructFieldDescriptor).

Enumerator
kBool 

bool.

kChar 

char.

kInt8 

int8.

kInt16 

int16.

kInt32 

int32.

kInt64 

int64.

kUint8 

uint8.

kUint16 

uint16.

kUint32 

uint32.

kUint64 

uint64.

kFloat 

float.

kDouble 

double.

kStruct 

struct.

Function Documentation

◆ AbsoluteDifference()

template<typename U , typename V , typename T = common_uint<U, V>>
T wpi::AbsoluteDifference ( U X,
V Y )
constexpr

Subtract two unsigned integers, X and Y, of type T and return the absolute value of the result.

◆ AddOverflow()

template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > wpi::AddOverflow ( T X,
T Y,
T & Result )

Add two signed integers, computing the two's complement truncated result, returning true if overflow occurred.

◆ adl_begin()

template<typename RangeT >
auto wpi::adl_begin ( RangeT && range) -> decltype(adl_detail::begin_impl(std::forward<RangeT>(range)))
constexpr

Returns the begin iterator to range using std::begin and function found through Argument-Dependent Lookup (ADL).

◆ adl_end()

template<typename RangeT >
auto wpi::adl_end ( RangeT && range) -> decltype(adl_detail::end_impl(std::forward<RangeT>(range)))
constexpr

Returns the end iterator to range using std::end and functions found through Argument-Dependent Lookup (ADL).

◆ adl_rbegin()

template<typename RangeT >
auto wpi::adl_rbegin ( RangeT && range) -> decltype(adl_detail::rbegin_impl(std::forward<RangeT>(range)))
constexpr

Returns the reverse-begin iterator to range using std::rbegin and function found through Argument-Dependent Lookup (ADL).

◆ adl_rend()

template<typename RangeT >
auto wpi::adl_rend ( RangeT && range) -> decltype(adl_detail::rend_impl(std::forward<RangeT>(range)))
constexpr

Returns the reverse-end iterator to range using std::rend and functions found through Argument-Dependent Lookup (ADL).

◆ adl_size()

template<typename RangeT >
auto wpi::adl_size ( RangeT && range) -> decltype(adl_detail::size_impl(std::forward<RangeT>(range)))
constexpr

Returns the size of range using std::size and functions found through Argument-Dependent Lookup (ADL).

◆ adl_swap()

template<typename T >
void wpi::adl_swap ( T && lhs,
T && rhs )
constexprnoexcept

Swaps lhs with rhs using std::swap and functions found through Argument-Dependent Lookup (ADL).

◆ alignDown()

template<typename U , typename V , typename W = uint8_t, typename T = common_uint<common_uint<U, V>, W>>
T wpi::alignDown ( U Value,
V Align,
W Skew = 0 )
constexpr

Returns the largest unsigned integer less than or equal to Value and is Skew mod Align.

Align must be non-zero. Guaranteed to never overflow.

◆ alignTo() [1/4]

template<typename U , typename V , typename T = common_uint<U, V>>
T wpi::alignTo ( U Value,
V Align )
constexpr

Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of Align.

Align must be non-zero.

Examples:

alignTo(5, 8) = 8
alignTo(17, 8) = 24
alignTo(~0LL, 8) = 0
alignTo(321, 255) = 510
constexpr T alignTo(U Value, V Align)
Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of A...
Definition MathExtras.h:461

Will overflow only if result is not representable in T.

◆ alignTo() [2/4]

template<typename U , typename V , typename W , typename T = common_uint<common_uint<U, V>, W>>
T wpi::alignTo ( U Value,
V Align,
W Skew )
constexpr

If non-zero Skew is specified, the return value will be a minimal integer that is greater than or equal to Size and equal to A * N + Skew for some integer N.

If Skew is larger than A, its value is adjusted to 'Skew mod A'. Align must be non-zero.

Examples:

alignTo(5, 8, 7) = 7
alignTo(17, 8, 1) = 17
alignTo(~0LL, 8, 3) = 3
alignTo(321, 255, 42) = 552

May overflow.

◆ alignTo() [3/4]

uint64_t wpi::alignTo ( uint64_t Value,
uint64_t Align )
constexpr

Fallback when arguments aren't integral.

◆ alignTo() [4/4]

template<auto Align, typename V , typename T = common_uint<decltype(Align), V>>
T wpi::alignTo ( V Value)
constexpr

Returns the next integer (mod 2**nbits) that is greater than or equal to Value and is a multiple of Align.

Align must be non-zero.

Will overflow only if result is not representable in T.

◆ alignToPowerOf2()

uint64_t wpi::alignToPowerOf2 ( uint64_t Value,
uint64_t Align )
constexpr

◆ allocate_buffer()

LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * wpi::allocate_buffer ( size_t Size,
size_t Alignment )

Allocate a buffer of memory with the given size and alignment.

When the compiler supports aligned operator new, this will use it to handle even over-aligned allocations.

However, this doesn't make any attempt to leverage the fancier techniques like posix_memalign due to portability. It is mostly intended to allow compatibility with platforms that, after aligned allocation was added, use reduced default alignment.

◆ array()

template<typename T , std::convertible_to< T >... Ts>
wpi::array ( T ,
Ts...  ) -> array< T, 1+sizeof...(Ts)>

◆ as_bytes()

template<typename Type , size_t Extent>
rotated_span< const std::byte, Extent==std::dynamic_extent ? std::dynamic_extent :Extent *sizeof(Type)> wpi::as_bytes ( rotated_span< Type, Extent > sp)
inlinenodiscardnoexcept

◆ as_writable_bytes()

template<typename Type , size_t Extent>
requires (!std::is_const_v<Type>)
rotated_span< std::byte, Extent==std::dynamic_extent ? std::dynamic_extent :Extent *sizeof(Type)> wpi::as_writable_bytes ( rotated_span< Type, Extent > sp)
inlinenodiscardnoexcept

◆ Base64Decode() [1/5]

size_t wpi::Base64Decode ( raw_ostream & os,
std::string_view encoded )

◆ Base64Decode() [2/5]

std::string_view wpi::Base64Decode ( std::string_view encoded,
size_t * num_read,
SmallVectorImpl< char > & buf )

◆ Base64Decode() [3/5]

std::span< uint8_t > wpi::Base64Decode ( std::string_view encoded,
size_t * num_read,
SmallVectorImpl< uint8_t > & buf )

◆ Base64Decode() [4/5]

size_t wpi::Base64Decode ( std::string_view encoded,
std::string * plain )

◆ Base64Decode() [5/5]

size_t wpi::Base64Decode ( std::string_view encoded,
std::vector< uint8_t > * plain )

◆ Base64Encode() [1/6]

void wpi::Base64Encode ( raw_ostream & os,
std::span< const uint8_t > plain )

◆ Base64Encode() [2/6]

void wpi::Base64Encode ( raw_ostream & os,
std::string_view plain )

◆ Base64Encode() [3/6]

std::string_view wpi::Base64Encode ( std::span< const uint8_t > plain,
SmallVectorImpl< char > & buf )

◆ Base64Encode() [4/6]

void wpi::Base64Encode ( std::span< const uint8_t > plain,
std::string * encoded )

◆ Base64Encode() [5/6]

std::string_view wpi::Base64Encode ( std::string_view plain,
SmallVectorImpl< char > & buf )

◆ Base64Encode() [6/6]

void wpi::Base64Encode ( std::string_view plain,
std::string * encoded )

◆ bit_cast()

template<typename To , typename From , typename = std::enable_if_t<sizeof(To) == sizeof(From)>, typename = std::enable_if_t<std::is_trivially_constructible<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<To>::value>, typename = std::enable_if_t<std::is_trivially_copyable<From>::value>>
To wpi::bit_cast ( const From & from)
inlinenodiscardnoexcept

◆ breakpoint()

void wpi::breakpoint ( )
inlinenoexcept

◆ breakpoint_if_debugging()

void wpi::breakpoint_if_debugging ( )
inlinenoexcept

◆ byteswap()

template<typename T , typename = std::enable_if_t<std::is_integral_v<T>>>
T wpi::byteswap ( T V)
nodiscardconstexprnoexcept

Reverses the bytes in the given integer value V.

◆ capacity_in_bytes() [1/2]

template<typename KeyT , typename ValueT , typename KeyInfoT >
size_t wpi::capacity_in_bytes ( const DenseMap< KeyT, ValueT, KeyInfoT > & X)
inline

◆ capacity_in_bytes() [2/2]

template<typename T , unsigned N>
size_t wpi::capacity_in_bytes ( const SmallVector< T, N > & X)
inline

◆ cast() [1/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( const From & Val)
inlinenodiscard

cast<X> - Return the argument parameter cast to the specified type.

This casting operator asserts that the type is correct, so it does not return null on failure. It does not allow a null argument (use cast_if_present for that). It is typically used like this:

cast<Instruction>(myVal)->getParent()

◆ cast() [2/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( From & Val)
inlinenodiscard

◆ cast() [3/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( From * Val)
inlinenodiscard

◆ cast() [4/4]

template<typename To , typename From >
decltype(auto) wpi::cast ( std::unique_ptr< From > && Val)
inlinenodiscard

◆ cast_if_present() [1/4]

template<class X , class Y >
auto wpi::cast_if_present ( const Y & Val)
inlinenodiscard

cast_if_present<X> - Functionally identical to cast, except that a null value is accepted.

◆ cast_if_present() [2/4]

template<class X , class Y >
auto wpi::cast_if_present ( std::unique_ptr< Y > && Val)
inlinenodiscard

◆ cast_if_present() [3/4]

template<class X , class Y >
auto wpi::cast_if_present ( Y & Val)
inlinenodiscard

◆ cast_if_present() [4/4]

template<class X , class Y >
auto wpi::cast_if_present ( Y * Val)
inlinenodiscard

◆ cast_or_null() [1/4]

template<class X , class Y >
auto wpi::cast_or_null ( const Y & Val)

◆ cast_or_null() [2/4]

template<class X , class Y >
auto wpi::cast_or_null ( std::unique_ptr< Y > && Val)

◆ cast_or_null() [3/4]

template<class X , class Y >
auto wpi::cast_or_null ( Y & Val)

◆ cast_or_null() [4/4]

template<class X , class Y >
auto wpi::cast_or_null ( Y * Val)

◆ compare_lower()

int wpi::compare_lower ( std::string_view lhs,
std::string_view rhs )
noexcept

compare_lower - Compare two strings, ignoring case.

◆ Concat()

template<typename Char , typename Traits , size_t N1, size_t... N>
auto wpi::Concat ( ct_string< Char, Traits, N1 > const & s1,
ct_string< Char, Traits, N > const &... s )
constexpr

Concatenates multiple fixed_strings into a larger fixed_string at compile time.

Parameters
s1first string
ssecond and later strings
Returns
concatenated string

◆ consume_integer()

template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true>
std::optional< T > wpi::consume_integer ( std::string_view * str,
unsigned radix )
inlinenoexcept

Parses the string str as an integer of the specified radix.

If radix is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.

If the string does not begin with a number of the specified radix, this returns nullopt to signify the error. The string is considered erroneous if empty or if it overflows T. The portion of the string representing the discovered numeric value is removed from the beginning of the string.

◆ contains() [1/3]

bool wpi::contains ( std::string_view str,
char ch )
constexprnoexcept

Checks if str contains the substring other.

◆ contains() [2/3]

bool wpi::contains ( std::string_view str,
const char * other )
constexprnoexcept

Checks if str contains the substring other.

◆ contains() [3/3]

bool wpi::contains ( std::string_view str,
std::string_view other )
constexprnoexcept

Checks if str contains the substring other.

◆ contains_lower() [1/3]

bool wpi::contains_lower ( std::string_view str,
char ch )
inlinenoexcept

Checks if str contains the substring other, ignoring case.

◆ contains_lower() [2/3]

bool wpi::contains_lower ( std::string_view str,
const char * other )
inlinenoexcept

Checks if str contains the substring other, ignoring case.

◆ contains_lower() [3/3]

bool wpi::contains_lower ( std::string_view str,
std::string_view other )
inlinenoexcept

Checks if str contains the substring other, ignoring case.

◆ ConvertCodePointToUTF8()

bool wpi::ConvertCodePointToUTF8 ( unsigned Source,
char *& ResultPtr )

Convert an Unicode code point to UTF8 sequence.

Parameters
Sourcea Unicode code point.
[in,out]ResultPtrpointer to the output buffer, needs to be at least UNI_MAX_UTF8_BYTES_PER_CODE_POINT bytes. On success ResultPtr is updated one past end of the converted sequence.
Returns:
true on success.

◆ ConvertUTF16toUTF32()

ConversionResult wpi::ConvertUTF16toUTF32 ( const UTF16 ** sourceStart,
const UTF16 * sourceEnd,
UTF32 ** targetStart,
UTF32 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF16toUTF8()

ConversionResult wpi::ConvertUTF16toUTF8 ( const UTF16 ** sourceStart,
const UTF16 * sourceEnd,
UTF8 ** targetStart,
UTF8 * targetEnd,
ConversionFlags flags )

◆ convertUTF16ToUTF8String() [1/2]

bool wpi::convertUTF16ToUTF8String ( std::span< const char > SrcBytes,
SmallVectorImpl< char > & Out )

Converts a stream of raw bytes assumed to be UTF16 into a UTF8 std::string.

Parameters
[in]SrcBytesA buffer of what is assumed to be UTF-16 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns:
true on success

◆ convertUTF16ToUTF8String() [2/2]

bool wpi::convertUTF16ToUTF8String ( std::span< const UTF16 > Src,
SmallVectorImpl< char > & Out )

Converts a UTF16 string into a UTF8 std::string.

Parameters
[in]SrcA buffer of UTF-16 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns:
true on success

◆ ConvertUTF32toUTF16()

ConversionResult wpi::ConvertUTF32toUTF16 ( const UTF32 ** sourceStart,
const UTF32 * sourceEnd,
UTF16 ** targetStart,
UTF16 * targetEnd,
ConversionFlags flags )

◆ ConvertUTF32toUTF8()

ConversionResult wpi::ConvertUTF32toUTF8 ( const UTF32 ** sourceStart,
const UTF32 * sourceEnd,
UTF8 ** targetStart,
UTF8 * targetEnd,
ConversionFlags flags )

◆ convertUTF32ToUTF8String() [1/2]

bool wpi::convertUTF32ToUTF8String ( std::span< const char > SrcBytes,
std::string & Out )

Converts a stream of raw bytes assumed to be UTF32 into a UTF8 std::string.

Parameters
[in]SrcBytesA buffer of what is assumed to be UTF-32 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns:
true on success

◆ convertUTF32ToUTF8String() [2/2]

bool wpi::convertUTF32ToUTF8String ( std::span< const UTF32 > Src,
std::string & Out )

Converts a UTF32 string into a UTF8 std::string.

Parameters
[in]SrcA buffer of UTF-32 encoded text.
[out]OutConverted UTF-8 is stored here on success.
Returns:
true on success

◆ convertUTF8Sequence()

ConversionResult wpi::convertUTF8Sequence ( const UTF8 ** source,
const UTF8 * sourceEnd,
UTF32 * target,
ConversionFlags flags )
inline

Convert the first UTF8 sequence in the given source buffer to a UTF32 code point.

Parameters
[in,out]sourceA pointer to the source buffer. If the conversion succeeds, this pointer will be updated to point to the byte just past the end of the converted sequence.
sourceEndA pointer just past the end of the source buffer.
[out]targetThe converted code
flagsWhether the conversion is strict or lenient.
Returns:
conversionOK on success
See also
ConvertUTF8toUTF32

◆ ConvertUTF8toUTF16()

ConversionResult wpi::ConvertUTF8toUTF16 ( const UTF8 ** sourceStart,
const UTF8 * sourceEnd,
UTF16 ** targetStart,
UTF16 * targetEnd,
ConversionFlags flags )

◆ convertUTF8ToUTF16String()

bool wpi::convertUTF8ToUTF16String ( std::string_view SrcUTF8,
SmallVectorImpl< UTF16 > & DstUTF16 )

Converts a UTF-8 string into a UTF-16 string with native endianness.

Returns:
true on success

◆ ConvertUTF8toUTF32()

ConversionResult wpi::ConvertUTF8toUTF32 ( const UTF8 ** sourceStart,
const UTF8 * sourceEnd,
UTF32 ** targetStart,
UTF32 * targetEnd,
ConversionFlags flags )

Convert a partial UTF8 sequence to UTF32.

If the sequence ends in an incomplete code unit sequence, returns sourceIllegal.

◆ ConvertUTF8toUTF32Partial()

ConversionResult wpi::ConvertUTF8toUTF32Partial ( const UTF8 ** sourceStart,
const UTF8 * sourceEnd,
UTF32 ** targetStart,
UTF32 * targetEnd,
ConversionFlags flags )

Convert a partial UTF8 sequence to UTF32.

If the sequence ends in an incomplete code unit sequence, returns sourceExhausted.

◆ ConvertUTF8toWide() [1/3]

bool wpi::ConvertUTF8toWide ( const char * Source,
std::wstring & Result )

Converts a UTF-8 C-string to a std::wstring.

Returns
true on success.

◆ ConvertUTF8toWide() [2/3]

bool wpi::ConvertUTF8toWide ( std::string_view Source,
std::wstring & Result )

Converts a UTF-8 string_view to a std::wstring.

Returns
true on success.

◆ ConvertUTF8toWide() [3/3]

bool wpi::ConvertUTF8toWide ( unsigned WideCharWidth,
std::string_view Source,
char *& ResultPtr,
const UTF8 *& ErrorPtr )

Convert an UTF8 string_view to UTF8, UTF16, or UTF32 depending on WideCharWidth.

The converted data is written to ResultPtr, which needs to point to at least WideCharWidth * (Source.Size() + 1) bytes. On success, ResultPtr will point one after the end of the copied string. On failure, ResultPtr will not be changed, and ErrorPtr will be set to the location of the first character which could not be converted.

Returns
true on success.

◆ convertWideToUTF8()

bool wpi::convertWideToUTF8 ( const std::wstring & Source,
SmallVectorImpl< char > & Result )

Converts a std::wstring to a UTF-8 encoded std::string.

Returns
true on success.

◆ CreateEvent()

WPI_EventHandle wpi::CreateEvent ( bool manualReset = false,
bool initialState = false )

Creates an event.

Events have binary state (signaled or not signaled) and may be either automatically reset or manually reset. Automatic-reset events go to non-signaled state when a WaitForObject is woken up by the event; manual-reset events require ResetEvent() to be called to set the event to non-signaled state; if ResetEvent() is not called, any waiter on that event will immediately wake when called.

Parameters
manualResettrue for manual reset, false for automatic reset
initialStatetrue to make the event initially in signaled state
Returns
Event handle

◆ CreateMessage()

template<typename T >
T * wpi::CreateMessage ( google::protobuf::Arena * arena)
inline

◆ CreateSemaphore()

WPI_SemaphoreHandle wpi::CreateSemaphore ( int initialCount = 0,
int maximumCount = INT_MAX )

Creates a semaphore.

Semaphores keep an internal counter. Releasing the semaphore increases the count. A semaphore with a non-zero count is considered signaled. When a waiter wakes up it atomically decrements the count by 1. This is generally useful in a single-supplier, multiple-consumer scenario.

Parameters
initialCountinitial value for the semaphore's internal counter
maximumCountmaximum value for the semaphore's internal counter
Returns
Semaphore handle

◆ CreateSignalObject()

void wpi::CreateSignalObject ( WPI_Handle handle,
bool manualReset = false,
bool initialState = false )

Sets up signaling for an arbitrary handle.

With this function, any handle can operate like an event handle.

Parameters
handleEvent handle
manualResettrue for manual reset, false for automatic reset
initialStatetrue to make the handle initially in signaled state

◆ ct_string()

template<typename Char , size_t M>
wpi::ct_string ( Char const (&) s[M]) -> ct_string< Char, std::char_traits< Char >, M - 1 >

◆ CTLog2()

template<size_t kValue>
size_t wpi::CTLog2 ( )
constexpr

Compile time Log2.

Valid only for positive powers of two.

◆ CTLog2< 1 >()

template<>
size_t wpi::CTLog2< 1 > ( )
constexpr

◆ deallocate_buffer()

void wpi::deallocate_buffer ( void * Ptr,
size_t Size,
size_t Alignment )

Deallocate a buffer of memory with the given size and alignment.

If supported, this will used the sized delete operator. Also if supported, this will pass the alignment to the delete operator.

The pointer must have been allocated with the corresponding new operator, most likely using the above helper.

◆ Demangle()

std::string wpi::Demangle ( std::string_view mangledSymbol)

Demangle a C++ symbol.

Parameters
mangledSymbolthe mangled symbol.
Returns
The demangled symbol, or mangledSymbol if demangling fails.

◆ DestroyEvent()

void wpi::DestroyEvent ( WPI_EventHandle handle)

Destroys an event.

Destruction wakes up any waiters.

Parameters
handleevent handle

◆ DestroySemaphore()

void wpi::DestroySemaphore ( WPI_SemaphoreHandle handle)

Destroys a semaphore.

Destruction wakes up any waiters.

Parameters
handlesemaphore handle

◆ DestroySignalObject()

void wpi::DestroySignalObject ( WPI_Handle handle)

Cleans up signaling for a handle.

Destruction wakes up any waiters.

Parameters
handlehandle

◆ divideCeil() [1/2]

template<typename U , typename V , typename T = common_uint<U, V>>
T wpi::divideCeil ( U Numerator,
V Denominator )
constexpr

Returns the integer ceil(Numerator / Denominator).

Unsigned version. Guaranteed to never overflow.

◆ divideCeil() [2/2]

uint64_t wpi::divideCeil ( uint64_t Numerator,
uint64_t Denominator )
constexpr

Fallback when arguments aren't integral.

◆ divideCeilSigned()

template<typename U , typename V , typename T = common_sint<U, V>>
T wpi::divideCeilSigned ( U Numerator,
V Denominator )
constexpr

Returns the integer ceil(Numerator / Denominator).

Signed version. Overflow is explicitly forbidden with an assert.

◆ divideFloorSigned()

template<typename U , typename V , typename T = common_sint<U, V>>
T wpi::divideFloorSigned ( U Numerator,
V Denominator )
constexpr

Returns the integer floor(Numerator / Denominator).

Signed version. Overflow is explicitly forbidden with an assert.

◆ divideNearest()

template<typename U , typename V , typename T = common_uint<U, V>>
T wpi::divideNearest ( U Numerator,
V Denominator )
constexpr

Returns (Numerator / Denominator) rounded by round-half-up.

Guaranteed to never overflow.

◆ divideSignedWouldOverflow()

template<typename U , typename V >
bool wpi::divideSignedWouldOverflow ( U Numerator,
V Denominator )
constexpr

◆ drop_back() [1/2]

template<typename T , size_t N>
std::span< T > wpi::drop_back ( std::span< T, N > in,
typename std::span< T >::size_type n = 1 )
constexpr

Drop the last N elements of the array.

◆ drop_back() [2/2]

std::string_view wpi::drop_back ( std::string_view str,
std::string_view::size_type n = 1 )
constexprnoexcept

Return a string_view equal to str but with the last n elements dropped.

◆ drop_front() [1/2]

template<typename T , size_t N>
std::span< T > wpi::drop_front ( std::span< T, N > in,
typename std::span< T >::size_type n = 1 )
constexpr

Drop the first N elements of the array.

◆ drop_front() [2/2]

std::string_view wpi::drop_front ( std::string_view str,
std::string_view::size_type n = 1 )
constexprnoexcept

Return a string_view equal to str but with the first n elements dropped.

◆ dyn_cast() [1/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( const From & Val)
inlinenodiscard

dyn_cast<X> - Return the argument parameter cast to the specified type.

This casting operator returns null if the argument is of the wrong type, so it can be used to test for a type as well as cast if successful. The value passed in must be present, if not, use dyn_cast_if_present. This should be used in the context of an if statement like this:

if (const Instruction *I = dyn_cast<Instruction>(myVal)) { ... }

◆ dyn_cast() [2/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( From & Val)
inlinenodiscard

◆ dyn_cast() [3/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( From * Val)
inlinenodiscard

◆ dyn_cast() [4/4]

template<typename To , typename From >
decltype(auto) wpi::dyn_cast ( std::unique_ptr< From > & Val)
inlinenodiscard

◆ dyn_cast_if_present() [1/3]

template<class X , class Y >
auto wpi::dyn_cast_if_present ( const Y & Val)

dyn_cast_if_present<X> - Functionally identical to dyn_cast, except that a null (or none in the case of optionals) value is accepted.

◆ dyn_cast_if_present() [2/3]

template<class X , class Y >
auto wpi::dyn_cast_if_present ( Y & Val)

◆ dyn_cast_if_present() [3/3]

template<class X , class Y >
auto wpi::dyn_cast_if_present ( Y * Val)

◆ dyn_cast_or_null() [1/3]

template<class X , class Y >
auto wpi::dyn_cast_or_null ( const Y & Val)

◆ dyn_cast_or_null() [2/3]

template<class X , class Y >
auto wpi::dyn_cast_or_null ( Y & Val)

◆ dyn_cast_or_null() [3/3]

template<class X , class Y >
auto wpi::dyn_cast_or_null ( Y * Val)

◆ ends_with() [1/3]

bool wpi::ends_with ( std::string_view str,
char suffix )
constexprnoexcept

Checks if str ends with the given suffix.

◆ ends_with() [2/3]

bool wpi::ends_with ( std::string_view str,
const char * suffix )
constexprnoexcept

Checks if str ends with the given suffix.

◆ ends_with() [3/3]

bool wpi::ends_with ( std::string_view str,
std::string_view suffix )
constexprnoexcept

Checks if str ends with the given suffix.

◆ ends_with_lower() [1/3]

bool wpi::ends_with_lower ( std::string_view str,
char suffix )
constexprnoexcept

Checks if str ends with the given suffix, ignoring case.

◆ ends_with_lower() [2/3]

bool wpi::ends_with_lower ( std::string_view str,
const char * suffix )
inlinenoexcept

Checks if str ends with the given suffix, ignoring case.

◆ ends_with_lower() [3/3]

bool wpi::ends_with_lower ( std::string_view str,
std::string_view suffix )
noexcept

Checks if str ends with the given suffix, ignoring case.

◆ equals()

bool wpi::equals ( std::string_view lhs,
std::string_view rhs )
constexprnoexcept

equals - Check for string equality, this is more efficient than compare() when the relative ordering of inequal strings isn't needed.

◆ equals_lower()

bool wpi::equals_lower ( std::string_view lhs,
std::string_view rhs )
constexprnoexcept

equals_lower - Check for string equality, ignoring case.

◆ erase_if()

template<typename T , typename Pred >
SmallVectorImpl< T >::size_type wpi::erase_if ( SmallVectorImpl< T > & c,
Pred pred )

◆ errs()

raw_fd_ostream & wpi::errs ( )

This returns a reference to a raw_ostream for standard error.

Use it like: errs() << "foo" << "bar"; By default, the stream is tied to stdout to ensure stdout is flushed before stderr is written, to ensure the error messages are written in their expected place.

◆ EscapeHTML()

std::string_view wpi::EscapeHTML ( std::string_view str,
SmallVectorImpl< char > & buf )

◆ EscapeURI()

std::string_view wpi::EscapeURI ( std::string_view str,
SmallVectorImpl< char > & buf,
bool spacePlus = true )

◆ find_lower() [1/3]

std::string_view::size_type wpi::find_lower ( std::string_view str,
char ch,
std::string_view::size_type from = 0 )
noexcept

Search for the first character ch in str, ignoring case.

Returns:
The index of the first occurrence of ch, or npos if not found.

◆ find_lower() [2/3]

std::string_view::size_type wpi::find_lower ( std::string_view str,
const char * other,
std::string_view::size_type from = 0 )
inlinenoexcept

Search for the first string other in str, ignoring case.

Returns:
The index of the first occurrence of other, or npos if not found.

◆ find_lower() [3/3]

std::string_view::size_type wpi::find_lower ( std::string_view str,
std::string_view other,
std::string_view::size_type from = 0 )
noexcept

Search for the first string other in str, ignoring case.

Returns:
The index of the first occurrence of other, or npos if not found.

◆ FindMultipartBoundary()

bool wpi::FindMultipartBoundary ( wpi::raw_istream & is,
std::string_view boundary,
std::string * saveBuf )

◆ for_each()

template<typename F , typename... Ts>
void wpi::for_each ( F && f,
Ts &&... elems )
constexpr

Calls f(i, elem) for each element of elems where i is the index of the element in elems and elem is the element.

Parameters
fThe callback.
elemsThe elements.

◆ ForEachStructSchema()

template<typename T , typename... I>
requires StructSerializable<T, I...>
void wpi::ForEachStructSchema ( std::invocable< std::string_view, std::string_view > auto fn,
const I &... info )

◆ format_to_n_c_str()

template<class OutputIt , class... Args>
void wpi::format_to_n_c_str ( OutputIt out,
std::iter_difference_t< OutputIt > n,
fmt::format_string< Args... > fmt,
Args &&... args )
inline

Like std::format_to_n() in that it writes at most n bytes to the output buffer, but also includes a terminating null byte in n.

This is essentially a more performant replacement for std::snprintf().

Parameters
outThe output buffer.
nThe size of the output buffer.
fmtThe format string.
argsThe format string arguments.

◆ get()

template<std::size_t I, typename PointerTy , unsigned IntBits, typename IntType , typename PtrTraits , typename Info >
decltype(auto) wpi::get ( const PointerIntPair< PointerTy, IntBits, IntType, PtrTraits, Info > & Pair)

◆ GetHostname() [1/2]

std::string wpi::GetHostname ( )

◆ GetHostname() [2/2]

std::string_view wpi::GetHostname ( SmallVectorImpl< char > & name)

◆ getNumBytesForUTF8()

unsigned wpi::getNumBytesForUTF8 ( UTF8 firstByte)

◆ GetStackTrace()

std::string wpi::GetStackTrace ( int offset)

Get a stack trace, ignoring the first "offset" symbols.

Parameters
offsetThe number of symbols at the top of the stack to ignore

◆ GetStackTraceDefault()

std::string wpi::GetStackTraceDefault ( int offset)

The default implementation used for GetStackTrace().

Parameters
offsetThe number of symbols at the top of the stack to ignore

◆ GetStructSchema()

template<typename T , typename... I>
requires StructSerializable<T, I...>
std::string_view wpi::GetStructSchema ( const I &... info)
constexpr

◆ GetStructSchemaBytes()

template<typename T , typename... I>
requires StructSerializable<T, I...>
std::span< const uint8_t > wpi::GetStructSchemaBytes ( const I &... info)
constexpr

◆ GetStructSize()

template<typename T , typename... I>
requires StructSerializable<T, I...>
size_t wpi::GetStructSize ( const I &... info)
constexpr

Get the size for a raw struct serializable type.

Template Parameters
Tserializable type
Parameters
infooptional struct type info
Returns
size

◆ GetStructTypeName()

template<typename T , typename... I>
requires StructSerializable<T, I...>
auto wpi::GetStructTypeName ( const I &... info)
constexpr

Get the type name for a raw struct serializable type.

Template Parameters
Tserializable type
Parameters
infooptional struct type info
Returns
type name

◆ GetStructTypeString()

template<typename T , typename... I>
requires StructSerializable<T, I...>
auto wpi::GetStructTypeString ( const I &... info)
constexpr

Get the type string for a raw struct serializable type.

Template Parameters
Tserializable type
Parameters
infooptional struct type info
Returns
type string (struct: followed by type name)

◆ GetSystemTime()

uint64_t wpi::GetSystemTime ( )

Return the current system time in microseconds since the Unix epoch (January 1st, 1970 00:00 UTC).

Returns
Time in microseconds.

◆ GetTypeName()

template<typename T >
std::string wpi::GetTypeName ( const T & type)

Returns the type name of an object.

Parameters
typeThe object

◆ getUTF8SequenceSize()

unsigned wpi::getUTF8SequenceSize ( const UTF8 * source,
const UTF8 * sourceEnd )

◆ hash_combine()

template<typename ... Ts>
hash_code wpi::hash_combine ( const Ts &... args)

Combine values into a single hash_code.

This routine accepts a varying number of arguments of any type. It will attempt to combine them into a single hash_code. For user-defined types it attempts to call a

See also
hash_value overload (via ADL) for the type. For integer and pointer types it directly combines their data into the resulting hash_code.

The result is suitable for returning from a user's hash_value implementation for their user-defined type. Consumers of a type should not call this routine, they should instead call 'hash_value'.

◆ hash_combine_range()

template<typename InputIteratorT >
hash_code wpi::hash_combine_range ( InputIteratorT first,
InputIteratorT last )

Compute a hash_code for a sequence of values.

This hashes a sequence of values. It produces the same hash_code as 'hash_combine(a, b, c, ...)', but can run over arbitrary sized sequences and is significantly faster given pointers and types which can be hashed as a sequence of bytes.

◆ hash_value() [1/6]

template<typename T >
hash_code wpi::hash_value ( const std::basic_string< T > & arg)

Compute a hash_code for a standard string.

◆ hash_value() [2/6]

template<typename T >
hash_code wpi::hash_value ( const std::optional< T > & arg)

Compute a hash_code for a standard string.

◆ hash_value() [3/6]

template<typename T , typename U >
hash_code wpi::hash_value ( const std::pair< T, U > & arg)

Compute a hash_code for a pair of objects.

◆ hash_value() [4/6]

template<typename... Ts>
hash_code wpi::hash_value ( const std::tuple< Ts... > & arg)

Compute a hash_code for a tuple.

◆ hash_value() [5/6]

template<typename T >
hash_code wpi::hash_value ( const T * ptr)

Compute a hash_code for a pointer's address.

N.B.: This hashes the address. Not the value and not the type.

◆ hash_value() [6/6]

template<typename T >
std::enable_if_t< is_integral_or_enum< T >::value, hash_code > wpi::hash_value ( T value)

Compute a hash_code for any integer value.

Note that this function is intended to compute the same hash_code for a particular value without regard to the pre-promotion type. This is in contrast to hash_combine which may produce different hash_codes for differing argument types even if they would implicit promote to a common type without changing the value.

◆ hasUTF16ByteOrderMark()

bool wpi::hasUTF16ByteOrderMark ( std::span< const char > SrcBytes)

Returns true if a blob of text starts with a UTF-16 big or little endian byte order mark.

◆ hexdigit()

char wpi::hexdigit ( unsigned X,
bool LowerCase = false )
constexprnoexcept

hexdigit - Return the hexadecimal character for the given number X (which should be less than 16).

◆ hexDigitValue()

unsigned wpi::hexDigitValue ( char C)
constexprnoexcept

Interpret the given character C as a hexadecimal digit and return its value.

If C is not a valid hex digit, -1U is returned.

◆ Hi_32()

uint32_t wpi::Hi_32 ( uint64_t Value)
constexpr

Return the high 32 bits of a 64 bit value.

◆ http_body_is_final()

int wpi::http_body_is_final ( const http_parser * parser)

◆ http_errno_description()

const char * wpi::http_errno_description ( enum http_errno err)

◆ http_errno_name()

const char * wpi::http_errno_name ( enum http_errno err)

◆ http_method_str()

const char * wpi::http_method_str ( enum http_method m)

◆ http_parser_execute()

size_t wpi::http_parser_execute ( http_parser * parser,
const http_parser_settings * settings,
const char * data,
size_t len )

◆ http_parser_init()

void wpi::http_parser_init ( http_parser * parser,
enum http_parser_type type )

◆ http_parser_parse_url()

int wpi::http_parser_parse_url ( const char * buf,
size_t buflen,
int is_connect,
struct http_parser_url * u )

◆ http_parser_pause()

void wpi::http_parser_pause ( http_parser * parser,
int paused )

◆ http_parser_settings_init()

void wpi::http_parser_settings_init ( http_parser_settings * settings)

◆ http_parser_url_init()

void wpi::http_parser_url_init ( struct http_parser_url * u)

◆ http_parser_version()

unsigned long wpi::http_parser_version ( void )

◆ http_should_keep_alive()

int wpi::http_should_keep_alive ( const http_parser * parser)

◆ http_status_str()

const char * wpi::http_status_str ( enum http_status s)

◆ insert_sorted()

template<typename T >
std::vector< T >::iterator wpi::insert_sorted ( std::vector< T > & vec,
T const & item )

◆ install_bad_alloc_error_handler()

void wpi::install_bad_alloc_error_handler ( fatal_error_handler_t handler,
void * user_data = nullptr )

Installs a new bad alloc error handler that should be used whenever a bad alloc error, e.g.

failing malloc/calloc, is encountered by LLVM.

The user can install a bad alloc handler, in order to define the behavior in case of failing allocations, e.g. throwing an exception. Note that this handler must not trigger any additional allocations itself.

If no error handler is installed the default is to print the error message to stderr, and call exit(1). If an error handler is installed then it is the handler's responsibility to log the message, it will no longer be printed to stderr. If the error handler returns, then exit(1) will be called.

Parameters
user_data- An argument which will be passed to the installed error handler.

◆ install_fatal_error_handler()

void wpi::install_fatal_error_handler ( fatal_error_handler_t handler,
void * user_data = nullptr )

install_fatal_error_handler - Installs a new error handler to be used whenever a serious (non-recoverable) error is encountered by LLVM.

If no error handler is installed the default is to print the error message to stderr, and call exit(1). If an error handler is installed then it is the handler's responsibility to log the message, it will no longer be printed to stderr. If the error handler returns, then exit(1) will be called.

It is dangerous to naively use an error handler which throws an exception. Even though some applications desire to gracefully recover from arbitrary faults, blindly throwing exceptions through unfamiliar code isn't a way to achieve this.

Parameters
user_data- An argument which will be passed to the install error handler.

◆ install_out_of_memory_new_handler()

void wpi::install_out_of_memory_new_handler ( )

◆ is_constexpr() [1/2]

bool wpi::is_constexpr ( ...)
constexpr

◆ is_constexpr() [2/2]

template<class Lambda , int = (Lambda{}(), 0)>
bool wpi::is_constexpr ( Lambda )
constexpr

◆ is_debugger_present()

bool wpi::is_debugger_present ( )
noexcept

◆ isa() [1/2]

template<typename To , typename From >
bool wpi::isa ( const From & Val)
inlinenodiscard

isa<X> - Return true if the parameter to the template is an instance of one of the template type arguments.

Used like this:

if (isa<Type>(myVal)) { ... } if (isa<Type0, Type1, Type2>(myVal)) { ... }

◆ isa() [2/2]

template<typename First , typename Second , typename... Rest, typename From >
bool wpi::isa ( const From & Val)
inlinenodiscard

◆ isa_and_nonnull()

template<typename... X, class Y >
bool wpi::isa_and_nonnull ( const Y & Val)
inlinenodiscard

◆ isa_and_present()

template<typename... X, class Y >
bool wpi::isa_and_present ( const Y & Val)
inlinenodiscard

isa_and_present<X> - Functionally identical to isa, except that a null value is accepted.

◆ isAlnum()

bool wpi::isAlnum ( char C)
constexprnoexcept

Checks whether character C is either a decimal digit or an uppercase or lowercase letter as classified by "C" locale.

◆ isAlpha()

bool wpi::isAlpha ( char C)
constexprnoexcept

Checks if character C is a valid letter as classified by "C" locale.

◆ isASCII()

bool wpi::isASCII ( char C)
constexprnoexcept

Checks whether character C is valid ASCII (high bit is zero).

◆ isDigit()

bool wpi::isDigit ( char C)
constexprnoexcept

Checks if character C is one of the 10 decimal digits.

◆ isHexDigit()

bool wpi::isHexDigit ( char C)
constexprnoexcept

Checks if character C is a hexadecimal numeric character.

◆ isInt()

template<unsigned N>
bool wpi::isInt ( int64_t x)
constexpr

Checks if an integer fits into the given bit width.

◆ isIntN()

bool wpi::isIntN ( unsigned N,
int64_t x )
inline

Checks if an signed integer fits into the given (dynamic) bit width.

◆ isLegalUTF8Sequence()

Boolean wpi::isLegalUTF8Sequence ( const UTF8 * source,
const UTF8 * sourceEnd )

◆ isLegalUTF8String()

Boolean wpi::isLegalUTF8String ( const UTF8 ** source,
const UTF8 * sourceEnd )

◆ isMask_32()

bool wpi::isMask_32 ( uint32_t Value)
constexpr

Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (32 bit version).

Ex. isMask_32(0x0000FFFFU) == true.

◆ isMask_64()

bool wpi::isMask_64 ( uint64_t Value)
constexpr

Return true if the argument is a non-empty sequence of ones starting at the least significant bit with the remainder zero (64 bit version).

◆ isPowerOf2_32()

bool wpi::isPowerOf2_32 ( uint32_t Value)
constexpr

Return true if the argument is a power of two > 0.

Ex. isPowerOf2_32(0x00100000U) == true (32 bit edition.)

◆ isPowerOf2_64()

bool wpi::isPowerOf2_64 ( uint64_t Value)
constexpr

Return true if the argument is a power of two > 0 (64 bit edition.)

◆ isPrint()

bool wpi::isPrint ( char C)
constexprnoexcept

Checks whether character C is printable.

Locale-independent version of the C standard library isprint whose results may differ on different platforms.

◆ isShiftedInt()

template<unsigned N, unsigned S>
bool wpi::isShiftedInt ( int64_t x)
constexpr

Checks if a signed integer is an N bit number shifted left by S.

◆ isShiftedMask_32() [1/2]

bool wpi::isShiftedMask_32 ( uint32_t Value)
constexpr

Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex.

isShiftedMask_32(0x0000FF00U) == true.

◆ isShiftedMask_32() [2/2]

bool wpi::isShiftedMask_32 ( uint32_t Value,
unsigned & MaskIdx,
unsigned & MaskLen )
inline

Return true if the argument contains a non-empty sequence of ones with the remainder zero (32 bit version.) Ex.

isShiftedMask_32(0x0000FF00U) == true. If true, MaskIdx will specify the index of the lowest set bit and MaskLen is updated to specify the length of the mask, else neither are updated.

◆ isShiftedMask_64() [1/2]

bool wpi::isShiftedMask_64 ( uint64_t Value)
constexpr

Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.)

◆ isShiftedMask_64() [2/2]

bool wpi::isShiftedMask_64 ( uint64_t Value,
unsigned & MaskIdx,
unsigned & MaskLen )
inline

Return true if the argument contains a non-empty sequence of ones with the remainder zero (64 bit version.) If true, MaskIdx will specify the index of the lowest set bit and MaskLen is updated to specify the length of the mask, else neither are updated.

◆ isShiftedUInt()

template<unsigned N, unsigned S>
bool wpi::isShiftedUInt ( uint64_t x)
constexpr

Checks if a unsigned integer is an N bit number shifted left by S.

◆ isUInt()

template<unsigned N>
bool wpi::isUInt ( uint64_t x)
constexpr

Checks if an unsigned integer fits into the given bit width.

◆ isUIntN()

bool wpi::isUIntN ( unsigned N,
uint64_t x )
inline

Checks if an unsigned integer fits into the given (dynamic) bit width.

◆ iterator_range()

template<typename Container >
wpi::iterator_range ( Container && ) -> iterator_range< wpi::detail::IterOfRange< Container > >

◆ Lerp()

template<typename T >
T wpi::Lerp ( const T & startValue,
const T & endValue,
double t )
constexpr

Linearly interpolates between two values.

Parameters
startValueThe start value.
endValueThe end value.
tThe fraction for interpolation.
Returns
The interpolated value.

◆ Lo_32()

uint32_t wpi::Lo_32 ( uint64_t Value)
constexpr

Return the low 32 bits of a 64 bit value.

◆ Log2_32()

unsigned wpi::Log2_32 ( uint32_t Value)
inline

Return the floor log base 2 of the specified value, -1 if the value is zero.

(32 bit edition.) Ex. Log2_32(32) == 5, Log2_32(1) == 0, Log2_32(0) == -1, Log2_32(6) == 2

◆ Log2_32_Ceil()

unsigned wpi::Log2_32_Ceil ( uint32_t Value)
inline

Return the ceil log base 2 of the specified value, 32 if the value is zero.

(32 bit edition). Ex. Log2_32_Ceil(32) == 5, Log2_32_Ceil(1) == 0, Log2_32_Ceil(6) == 3

◆ Log2_64()

unsigned wpi::Log2_64 ( uint64_t Value)
inline

Return the floor log base 2 of the specified value, -1 if the value is zero.

(64 bit edition.)

◆ Log2_64_Ceil()

unsigned wpi::Log2_64_Ceil ( uint64_t Value)
inline

Return the ceil log base 2 of the specified value, 64 if the value is zero.

(64 bit edition.)

◆ ltrim() [1/2]

std::string_view wpi::ltrim ( std::string_view str,
char ch )
constexprnoexcept

Returns str with consecutive ch characters starting from the the left removed.

◆ ltrim() [2/2]

std::string_view wpi::ltrim ( std::string_view str,
std::string_view chars = " \t\n\v\f\r" )
constexprnoexcept

Returns str with consecutive characters in chars starting from the left removed.

◆ Make_64()

uint64_t wpi::Make_64 ( uint32_t High,
uint32_t Low )
constexpr

Make a 64-bit integer from a high / low pair of 32-bit integers.

◆ make_error_code()

std::error_code wpi::make_error_code ( errc E)
inline

◆ make_pointee_range()

template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointee_iterator< WrappedIteratorT > > wpi::make_pointee_range ( RangeT && Range)

◆ make_pointer_range()

template<typename RangeT , typename WrappedIteratorT = decltype(std::begin(std::declval<RangeT>()))>
iterator_range< pointer_iterator< WrappedIteratorT > > wpi::make_pointer_range ( RangeT && Range)

◆ make_range() [1/2]

template<typename T >
iterator_range< T > wpi::make_range ( std::pair< T, T > p)

◆ make_range() [2/2]

template<class T >
iterator_range< T > wpi::make_range ( T x,
T y )

Convenience function for iterating over sub-ranges.

This provides a bit of syntactic sugar to make using sub-ranges in for loops a bit easier. Analogous to std::make_pair().

◆ make_ready_future() [1/2]

future< void > wpi::make_ready_future ( )
inline

Constructs a valid future with the value set.

◆ make_ready_future() [2/2]

template<typename T >
future< T > wpi::make_ready_future ( T && value)
inline

Constructs a valid future with the value set.

◆ make_string()

WPI_String wpi::make_string ( std::string_view view)
constexpr

Converts a string_view to a WPI_String.

◆ make_unexpected()

template<class E >
unexpected< typename std::decay< E >::type > wpi::make_unexpected ( E && e)

◆ MakeStructArraySchema()

template<typename T , size_t N, typename... I>
requires StructSerializable<T, I...>
auto wpi::MakeStructArraySchema ( const I &... info)
constexpr

◆ MakeStructArrayTypeName()

template<typename T , size_t N, typename... I>
requires StructSerializable<T, I...>
auto wpi::MakeStructArrayTypeName ( const I &... info)
constexpr

◆ MakeStructArrayTypeString()

template<typename T , size_t N, typename... I>
requires StructSerializable<T, I...>
auto wpi::MakeStructArrayTypeString ( const I &... info)
constexpr

◆ mapLastWindowsError()

std::error_code wpi::mapLastWindowsError ( )

◆ mapWindowsError()

std::error_code wpi::mapWindowsError ( unsigned EV)

◆ maskLeadingOnes()

template<typename T >
T wpi::maskLeadingOnes ( unsigned N)

Create a bitmask with the N left-most bits set to 1, and all other bits set to 0.

Only unsigned types are allowed.

◆ maskLeadingZeros()

template<typename T >
T wpi::maskLeadingZeros ( unsigned N)

Create a bitmask with the N left-most bits set to 0, and all other bits set to 1.

Only unsigned types are allowed.

◆ maskTrailingOnes()

template<typename T >
T wpi::maskTrailingOnes ( unsigned N)

Create a bitmask with the N right-most bits set to 1, and all other bits set to 0.

Only unsigned types are allowed.

◆ maskTrailingZeros()

template<typename T >
T wpi::maskTrailingZeros ( unsigned N)

Create a bitmask with the N right-most bits set to 0, and all other bits set to 1.

Only unsigned types are allowed.

◆ maxIntN()

int64_t wpi::maxIntN ( int64_t N)
inline

Gets the maximum value for a N-bit signed integer.

◆ maxUIntN()

uint64_t wpi::maxUIntN ( uint64_t N)
inline

Gets the maximum value for a N-bit unsigned integer.

◆ MimeTypeFromPath()

std::string_view wpi::MimeTypeFromPath ( std::string_view path)

◆ MinAlign() [1/2]

template<typename U , typename V , typename T = common_uint<U, V>>
T wpi::MinAlign ( U A,
V B )
constexpr

A and B are either alignments or offsets.

Return the minimum alignment that may be assumed after adding the two together.

◆ MinAlign() [2/2]

uint64_t wpi::MinAlign ( uint64_t A,
uint64_t B )
constexpr

Fallback when arguments aren't integral.

◆ minIntN()

int64_t wpi::minIntN ( int64_t N)
inline

Gets the minimum value for a N-bit signed integer.

◆ mod()

template<typename U , typename V , typename T = common_sint<U, V>>
T wpi::mod ( U Numerator,
V Denominator )
constexpr

Returns the remainder of the Euclidean division of LHS by RHS.

Result is always non-negative.

◆ MulOverflow()

template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > wpi::MulOverflow ( T X,
T Y,
T & Result )

Multiply two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.

◆ NextPowerOf2()

uint64_t wpi::NextPowerOf2 ( uint64_t A)
constexpr

Returns the next power of two (in 64-bits) that is strictly greater than A.

Returns zero on overflow.

◆ Now()

uint64_t wpi::Now ( )

Return a value representing the current time in microseconds.

This is a monotonic clock with an undefined epoch.

Returns
Time in microseconds.

◆ NowDefault()

uint64_t wpi::NowDefault ( )

The default implementation used for Now().

In general this is the time returned by the operating system.

Returns
Time in microseconds.

◆ nulls()

raw_ostream & wpi::nulls ( )

This returns a reference to a raw_ostream which simply discards output.

◆ NumToCtString()

template<intmax_t N, int Base = 10, typename Char = char, typename Traits = std::char_traits<Char>>
requires (Base >= 2 && Base <= 36)
auto wpi::NumToCtString ( )
constexpr

Converts any integral to a ct_string at compile-time.

Template Parameters
Nnumber to convert
Basedesired base, can be from 2 to 36
Charcharacter type
Traitscharacter traits

◆ operator!=() [1/11]

template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
bool wpi::operator!= ( const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & LHS,
const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & RHS )

Inequality comparison for DenseMap.

Equivalent to !(LHS == RHS). See operator== for performance notes.

◆ operator!=() [2/11]

template<class T , class E , class U , class F >
bool wpi::operator!= ( const expected< T, E > & lhs,
const expected< U, F > & rhs )
constexpr

◆ operator!=() [3/11]

template<class T , class E , class U >
bool wpi::operator!= ( const expected< T, E > & x,
const U & v )
constexpr

◆ operator!=() [4/11]

template<class T , class E >
bool wpi::operator!= ( const expected< T, E > & x,
const unexpected< E > & e )
constexpr

◆ operator!=() [5/11]

template<class E , class F >
bool wpi::operator!= ( const expected< void, E > & lhs,
const expected< void, F > & rhs )
constexpr

◆ operator!=() [6/11]

template<typename PtrType >
bool wpi::operator!= ( const SmallPtrSetImpl< PtrType > & LHS,
const SmallPtrSetImpl< PtrType > & RHS )

Inequality comparison for SmallPtrSet.

Equivalent to !(LHS == RHS).

◆ operator!=() [7/11]

template<typename T , unsigned LN, unsigned RN, typename C >
bool wpi::operator!= ( const SmallSet< T, LN, C > & LHS,
const SmallSet< T, RN, C > & RHS )

Inequality comparison for SmallSet.

Equivalent to !(LHS == RHS). See operator== for performance notes.

◆ operator!=() [8/11]

template<class T , class E , class U >
bool wpi::operator!= ( const U & v,
const expected< T, E > & x )
constexpr

◆ operator!=() [9/11]

template<class T , class E >
bool wpi::operator!= ( const unexpected< E > & e,
const expected< T, E > & x )
constexpr

◆ operator!=() [10/11]

template<class E >
bool wpi::operator!= ( const unexpected< E > & lhs,
const unexpected< E > & rhs )
constexpr

◆ operator!=() [11/11]

template<typename ... PTs>
bool wpi::operator!= ( PointerUnion< PTs... > lhs,
PointerUnion< PTs... > rhs )

◆ operator&()

default_arguments wpi::operator& ( const default_arguments & a,
const default_arguments & b )
inline

◆ operator+()

template<typename Char , typename Traits , size_t N1, size_t N2>
auto wpi::operator+ ( ct_string< Char, Traits, N1 > const & s1,
ct_string< Char, Traits, N2 > const & s2 )
constexprnoexcept

◆ operator<() [1/2]

template<class E >
bool wpi::operator< ( const unexpected< E > & lhs,
const unexpected< E > & rhs )
constexpr

◆ operator<() [2/2]

template<typename ... PTs>
bool wpi::operator< ( PointerUnion< PTs... > lhs,
PointerUnion< PTs... > rhs )

◆ operator<<() [1/3]

template<typename OStream , typename T >
std::enable_if_t<!std::is_reference_v< OStream > && std::is_base_of_v< raw_ostream, OStream >, OStream && > wpi::operator<< ( OStream && OS,
const T & Value )

Call the appropriate insertion operator, given an rvalue reference to a raw_ostream object and return a stream of the same type as the argument.

◆ operator<<() [2/3]

raw_ostream & wpi::operator<< ( raw_ostream & OS,
sys::TimePoint<> TP )

◆ operator<<() [3/3]

raw_ostream & wpi::operator<< ( raw_ostream & OS,
sys::UtcTime<> TP )

◆ operator<=()

template<class E >
bool wpi::operator<= ( const unexpected< E > & lhs,
const unexpected< E > & rhs )
constexpr

◆ operator==() [1/11]

template<typename DerivedT , typename KeyT , typename ValueT , typename KeyInfoT , typename BucketT >
bool wpi::operator== ( const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & LHS,
const DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT > & RHS )

Equality comparison for DenseMap.

Iterates over elements of LHS confirming that each (key, value) pair in LHS is also in RHS, and that no additional pairs are in RHS. Equivalent to N calls to RHS.find and N value comparisons. Amortized complexity is linear, worst case is O(N^2) (if every hash collides).

◆ operator==() [2/11]

template<class T , class E , class U , class F >
bool wpi::operator== ( const expected< T, E > & lhs,
const expected< U, F > & rhs )
constexpr

◆ operator==() [3/11]

template<class T , class E , class U >
bool wpi::operator== ( const expected< T, E > & x,
const U & v )
constexpr

◆ operator==() [4/11]

template<class T , class E >
bool wpi::operator== ( const expected< T, E > & x,
const unexpected< E > & e )
constexpr

◆ operator==() [5/11]

template<class E , class F >
bool wpi::operator== ( const expected< void, E > & lhs,
const expected< void, F > & rhs )
constexpr

◆ operator==() [6/11]

template<typename PtrType >
bool wpi::operator== ( const SmallPtrSetImpl< PtrType > & LHS,
const SmallPtrSetImpl< PtrType > & RHS )

Equality comparison for SmallPtrSet.

Iterates over elements of LHS confirming that each value from LHS is also in RHS, and that no additional values are in RHS.

◆ operator==() [7/11]

template<typename T , unsigned LN, unsigned RN, typename C >
bool wpi::operator== ( const SmallSet< T, LN, C > & LHS,
const SmallSet< T, RN, C > & RHS )

Equality comparison for SmallSet.

Iterates over elements of LHS confirming that each element is also a member of RHS, and that RHS contains no additional values. Equivalent to N calls to RHS.count. For small-set mode amortized complexity is O(N^2) For large-set mode amortized complexity is linear, worst case is O(N^2) (if every hash collides).

◆ operator==() [8/11]

template<class T , class E , class U >
bool wpi::operator== ( const U & v,
const expected< T, E > & x )
constexpr

◆ operator==() [9/11]

template<class T , class E >
bool wpi::operator== ( const unexpected< E > & e,
const expected< T, E > & x )
constexpr

◆ operator==() [10/11]

template<class E >
bool wpi::operator== ( const unexpected< E > & lhs,
const unexpected< E > & rhs )
constexpr

◆ operator==() [11/11]

template<typename ... PTs>
bool wpi::operator== ( PointerUnion< PTs... > lhs,
PointerUnion< PTs... > rhs )

◆ operator>()

template<class E >
bool wpi::operator> ( const unexpected< E > & lhs,
const unexpected< E > & rhs )
constexpr

◆ operator>=()

template<class E >
bool wpi::operator>= ( const unexpected< E > & lhs,
const unexpected< E > & rhs )
constexpr

◆ outs()

raw_fd_ostream & wpi::outs ( )

This returns a reference to a raw_fd_ostream for standard output.

Use it like: outs() << "foo" << "bar";

◆ PackStruct() [1/2]

template<typename T , typename... I>
requires StructSerializable<T, I...>
void wpi::PackStruct ( std::span< uint8_t > data,
T && value,
const I &... info )
inline

Pack a serialized struct.

Parameters
datastruct storage (mutable, output)
valueobject
infooptional struct type info

◆ PackStruct() [2/2]

template<size_t Offset, typename T , typename... I>
requires StructSerializable<T, I...>
void wpi::PackStruct ( std::span< uint8_t > data,
T && value,
const I &... info )
inline

Pack a serialized struct starting at a given offset within the data.

This is primarily useful in pack implementations to pack nested structs.

Template Parameters
Offsetstarting offset
Parameters
datastruct storage (mutable, output)
valueobject
infooptional struct type info

◆ PackStructArray()

template<size_t Offset, size_t N, StructSerializable T>
void wpi::PackStructArray ( std::span< uint8_t > data,
const wpi::array< T, N > & arr )
inline

Pack a serialized struct array starting at a given offset within the data.

This is primarily useful in pack implementations to pack nested struct arrays.

Template Parameters
Offsetstarting offset
Nnumber of objects
Parameters
datastruct storage (mutable, output)
arrarray of object

◆ parse_float()

template<typename T >
std::optional< T > wpi::parse_float ( std::string_view str)
noexcept

Parses the string str as a floating point value.

If the string is invalid or if only a subset of the string is valid, this returns nullopt to signify the error. The string is considered erroneous if empty or if it overflows T.

◆ parse_float< double >()

template<>
std::optional< double > wpi::parse_float< double > ( std::string_view str)
noexcept

◆ parse_float< float >()

template<>
std::optional< float > wpi::parse_float< float > ( std::string_view str)
noexcept

◆ parse_float< long double >()

template<>
std::optional< long double > wpi::parse_float< long double > ( std::string_view str)
noexcept

◆ parse_integer()

template<typename T , std::enable_if_t< std::numeric_limits< T >::is_signed, bool > = true>
std::optional< T > wpi::parse_integer ( std::string_view str,
unsigned radix )
inlinenoexcept

Parses the string str as an integer of the specified radix.

If radix is specified as zero, this does radix autosensing using extended C rules: 0 is octal, 0x is hex, 0b is binary.

If the string is invalid or if only a subset of the string is valid, this returns nullopt to signify the error. The string is considered erroneous if empty or if it overflows T.

◆ ParseHttpHeaders()

bool wpi::ParseHttpHeaders ( raw_istream & is,
SmallVectorImpl< char > * contentType,
SmallVectorImpl< char > * contentLength )

◆ PowerOf2Ceil()

uint64_t wpi::PowerOf2Ceil ( uint64_t A)
inline

Returns the power of two which is greater than or equal to the given value.

Essentially, it is a ceil operation across the domain of powers of two.

◆ print() [1/3]

template<typename... T>
void wpi::print ( fmt::format_string< T... > fmt,
T &&... args )
inline

Wrapper around fmt::print() that squelches write failure exceptions.

◆ print() [2/3]

template<typename... T>
void wpi::print ( std::FILE * f,
fmt::format_string< T... > fmt,
T &&... args )
inline

Wrapper around fmt::print() that squelches write failure exceptions.

◆ print() [3/3]

template<typename S , typename... Args>
void wpi::print ( wpi::raw_ostream & os,
const S & format_str,
Args &&... args )

Prints formatted data to the stream os.

◆ println() [1/2]

template<typename... T>
void wpi::println ( fmt::format_string< T... > fmt,
T &&... args )
inline

Wrapper around fmt::println() that squelches write failure exceptions.

◆ println() [2/2]

template<typename... T>
void wpi::println ( std::FILE * f,
fmt::format_string< T... > fmt,
T &&... args )
inline

Wrapper around fmt::println() that squelches write failure exceptions.

◆ ReadUleb128() [1/2]

uint64_t wpi::ReadUleb128 ( const char * addr,
uint64_t * ret )

Read unsigned LEB128 data.

Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes read.

Parameters
addrThe address where the ULEB128 data is stored.
retAddress to store the result.

◆ ReadUleb128() [2/2]

bool wpi::ReadUleb128 ( raw_istream & is,
uint64_t * ret )

Read unsigned LEB128 data from a stream.

Decode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return false on stream error, true on success.

Parameters
isThe input stream where the ULEB128 data is to be read from.
retAddress to store the result.

◆ ReleaseSemaphore()

bool wpi::ReleaseSemaphore ( WPI_SemaphoreHandle handle,
int releaseCount = 1,
int * prevCount = nullptr )

Releases N counts of a semaphore.

Parameters
handlesemaphore handle
releaseCountamount to add to semaphore's internal counter; must be positive
prevCountif non-null, previous count (output parameter)
Returns
True on successful release, false on failure (e.g. release count would exceed maximum value, or handle invalid)

◆ remove_bad_alloc_error_handler()

void wpi::remove_bad_alloc_error_handler ( )

Restores default bad alloc error handling behavior.

◆ remove_fatal_error_handler()

void wpi::remove_fatal_error_handler ( )

Restores default error handling behaviour.

◆ remove_prefix()

std::optional< std::string_view > wpi::remove_prefix ( std::string_view str,
std::string_view prefix )
constexprnoexcept

Return an optional containing str but with prefix removed if the string starts with the prefix.

If the string does not start with the prefix, return an empty optional.

◆ remove_suffix()

std::optional< std::string_view > wpi::remove_suffix ( std::string_view str,
std::string_view suffix )
constexprnoexcept

Return an optional containing str but with suffix removed if the string ends with the suffix.

If the string does not end with the suffix, return an empty optional.

◆ report_bad_alloc_error()

void wpi::report_bad_alloc_error ( const char * Reason,
bool GenCrashDiag = true )

Reports a bad alloc error, calling any user defined bad alloc error handler.

In contrast to the generic 'report_fatal_error' functions, this function might not terminate, e.g. the user defined error handler throws an exception, but it won't return.

Note: When throwing an exception in the bad alloc handler, make sure that the following unwind succeeds, e.g. do not trigger additional allocations in the unwind chain.

If no error handler is installed (default), throws a bad_alloc exception if LLVM is compiled with exception support. Otherwise prints the error to standard error and calls abort().

◆ report_fatal_error() [1/3]

void wpi::report_fatal_error ( const char * reason,
bool gen_crash_diag = true )

Reports a serious error, calling any installed error handler.

These functions are intended to be used for error conditions which are outside the control of the compiler (I/O errors, invalid user input, etc.)

If no error handler is installed the default is to print the message to standard error, followed by a newline. After the error handler is called this function will call abort(), it does not return.

◆ report_fatal_error() [2/3]

void wpi::report_fatal_error ( const std::string & reason,
bool gen_crash_diag = true )

◆ report_fatal_error() [3/3]

void wpi::report_fatal_error ( std::string_view reason,
bool gen_crash_diag = true )

◆ ResetEvent()

void wpi::ResetEvent ( WPI_EventHandle handle)

Sets an event to non-signaled state.

Parameters
handleevent handle

◆ ResetSignalObject()

void wpi::ResetSignalObject ( WPI_Handle handle)

Sets a handle to non-signaled state.

Parameters
handlehandle

◆ reverseBits()

template<typename T >
T wpi::reverseBits ( T Val)

Reverse the bits in Val.

◆ rfind_lower() [1/3]

std::string_view::size_type wpi::rfind_lower ( std::string_view str,
char ch,
std::string_view::size_type from = std::string_view::npos )
noexcept

Search for the last character ch in str, ignoring case.

Returns:
The index of the last occurrence of ch, or npos if not found.

◆ rfind_lower() [2/3]

std::string_view::size_type wpi::rfind_lower ( std::string_view str,
const char * other )
inlinenoexcept

Search for the last string other in str, ignoring case.

Returns:
The index of the last occurrence of other, or npos if not found.

◆ rfind_lower() [3/3]

std::string_view::size_type wpi::rfind_lower ( std::string_view str,
std::string_view other )
noexcept

Search for the last string other in str, ignoring case.

Returns:
The index of the last occurrence of other, or npos if not found.

◆ rotated_span() [1/3]

template<std::contiguous_iterator It, typename End >
wpi::rotated_span ( It ,
End  ) -> rotated_span< std::remove_reference_t< std::iter_reference_t< It > > >

◆ rotated_span() [2/3]

template<typename Type , size_t ArrayExtent>
wpi::rotated_span ( std::array< Type, ArrayExtent > & ) -> rotated_span< Type, ArrayExtent >

◆ rotated_span() [3/3]

template<typename Type , size_t ArrayExtent>
wpi::rotated_span ( Type(&) [ArrayExtent]) -> rotated_span< Type, ArrayExtent >

◆ rsplit() [1/2]

std::pair< std::string_view, std::string_view > wpi::rsplit ( std::string_view str,
char separator )
constexprnoexcept

Splits str into two substrings around the last occurrence of a separator character.

If separator is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is minimal. If separator is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").

Parameters
separatorThe string to split on.
Returns
The split substrings.

◆ rsplit() [2/2]

std::pair< std::string_view, std::string_view > wpi::rsplit ( std::string_view str,
std::string_view separator )
constexprnoexcept

Splits str into two substrings around the last occurrence of a separator string.

If separator is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is minimal. If separator is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").

Parameters
separatorThe string to split on.
Returns
The split substrings.

◆ rtrim() [1/2]

std::string_view wpi::rtrim ( std::string_view str,
char ch )
constexprnoexcept

Returns str with consecutive Char characters starting from the right removed.

◆ rtrim() [2/2]

std::string_view wpi::rtrim ( std::string_view str,
std::string_view chars = " \t\n\v\f\r" )
constexprnoexcept

Returns str with consecutive characters in chars starting from the right removed.

◆ safe_calloc()

LLVM_ATTRIBUTE_RETURNS_NONNULL void * wpi::safe_calloc ( size_t Count,
size_t Sz )
inline

◆ safe_malloc()

LLVM_ATTRIBUTE_RETURNS_NONNULL void * wpi::safe_malloc ( size_t Sz)
inline

◆ safe_realloc()

LLVM_ATTRIBUTE_RETURNS_NONNULL void * wpi::safe_realloc ( void * Ptr,
size_t Sz )
inline

◆ SaturatingAdd() [1/2]

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingAdd ( T X,
T Y,
bool * ResultOverflowed = nullptr )

Add two unsigned integers, X and Y, of type T.

Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.

◆ SaturatingAdd() [2/2]

template<class T , class... Ts>
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingAdd ( T X,
T Y,
T Z,
Ts... Args )

Add multiple unsigned integers of type T.

Clamp the result to the maximum representable value of T on overflow.

◆ SaturatingMultiply()

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingMultiply ( T X,
T Y,
bool * ResultOverflowed = nullptr )

Multiply two unsigned integers, X and Y, of type T.

Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.

◆ SaturatingMultiplyAdd()

template<typename T >
std::enable_if_t< std::is_unsigned_v< T >, T > wpi::SaturatingMultiplyAdd ( T X,
T Y,
T A,
bool * ResultOverflowed = nullptr )

Multiply two unsigned integers, X and Y, and add the unsigned integer, A to the product.

Clamp the result to the maximum representable value of T on overflow. ResultOverflowed indicates if the result is larger than the maximum representable value of type T.

◆ SetEvent()

void wpi::SetEvent ( WPI_EventHandle handle)

Sets an event to signaled state.

Parameters
handleevent handle

◆ SetGetStackTraceImpl()

void wpi::SetGetStackTraceImpl ( std::string(* func )(int offset))

Set the implementation used by GetStackTrace().

Parameters
funcFunction called by GetStackTrace().

◆ SetNowImpl()

void wpi::SetNowImpl ( uint64_t(* func )())

Set the implementation used by Now().

The implementation must return monotonic time in microseconds to maintain the contract of Now().

Parameters
funcFunction called by Now() to return the time.

◆ SetSignalObject()

void wpi::SetSignalObject ( WPI_Handle handle)

Sets a handle to signaled state.

Parameters
handlehandle

◆ sgn()

template<typename T >
int wpi::sgn ( T val)
constexpr

◆ shouldReverseIterate()

template<class T = void *>
bool wpi::shouldReverseIterate ( )

◆ SignExtend32() [1/2]

template<unsigned B>
int32_t wpi::SignExtend32 ( uint32_t X)
constexpr

Sign-extend the number in the bottom B bits of X to a 32-bit integer.

Requires B <= 32.

◆ SignExtend32() [2/2]

int32_t wpi::SignExtend32 ( uint32_t X,
unsigned B )
inline

Sign-extend the number in the bottom B bits of X to a 32-bit integer.

Requires B <= 32.

◆ SignExtend64() [1/2]

template<unsigned B>
int64_t wpi::SignExtend64 ( uint64_t x)
constexpr

Sign-extend the number in the bottom B bits of X to a 64-bit integer.

Requires B <= 64.

◆ SignExtend64() [2/2]

int64_t wpi::SignExtend64 ( uint64_t X,
unsigned B )
inline

Sign-extend the number in the bottom B bits of X to a 64-bit integer.

Requires B <= 64.

◆ SizeUleb128()

uint64_t wpi::SizeUleb128 ( uint64_t val)

Get size of unsigned LEB128 data.

Determine the number of bytes required to encode an unsigned LEB128 datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes required.

Parameters
valLEB128 data.

◆ slice()

std::string_view wpi::slice ( std::string_view str,
std::string_view::size_type start,
std::string_view::size_type end )
constexprnoexcept

Returns a reference to the substring of str from [start, end).

Parameters
startThe index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned.
endThe index following the last character to include in the substring. If this is npos or exceeds the number of characters remaining in the string, the string suffix (starting with start) will be returned. If this is less than start, an empty string will be returned.

◆ SocketErrno()

int wpi::SocketErrno ( )

◆ SocketStrerror() [1/2]

std::string wpi::SocketStrerror ( )
inline

◆ SocketStrerror() [2/2]

std::string wpi::SocketStrerror ( int code)

◆ split() [1/4]

std::pair< std::string_view, std::string_view > wpi::split ( std::string_view str,
char separator )
constexprnoexcept

Splits str into two substrings around the first occurrence of a separator character.

If separator is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is maximal. If separator is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").

Parameters
separatorThe character to split on.
Returns:
The split substrings.

◆ split() [2/4]

void wpi::split ( std::string_view str,
SmallVectorImpl< std::string_view > & arr,
char separator,
int maxSplit = -1,
bool keepEmpty = true )
noexcept

Splits str into substrings around the occurrences of a separator character.

Each substring is stored in arr. If maxSplit is >= 0, at most maxSplit splits are done and consequently <= maxSplit + 1 elements are added to arr. If keepEmpty is false, empty strings are not added to arr. They still count when considering maxSplit An useful invariant is that separator.join(arr) == str if maxSplit == -1 and keepEmpty == true

Parameters
arrWhere to put the substrings.
separatorThe character to split on.
maxSplitThe maximum number of times the string is split.
keepEmptyTrue if empty substring should be added.

◆ split() [3/4]

void wpi::split ( std::string_view str,
SmallVectorImpl< std::string_view > & arr,
std::string_view separator,
int maxSplit = -1,
bool keepEmpty = true )
noexcept

Splits str into substrings around the occurrences of a separator string.

Each substring is stored in arr. If maxSplit is >= 0, at most maxSplit splits are done and consequently <= maxSplit + 1 elements are added to arr. If keepEmpty is false, empty strings are not added to arr. They still count when considering maxSplit An useful invariant is that separator.join(arr) == str if maxSplit == -1 and keepEmpty == true

Parameters
arrWhere to put the substrings.
separatorThe string to split on.
maxSplitThe maximum number of times the string is split.
keepEmptyTrue if empty substring should be added.

◆ split() [4/4]

std::pair< std::string_view, std::string_view > wpi::split ( std::string_view str,
std::string_view separator )
constexprnoexcept

Splits str into two substrings around the first occurrence of a separator string.

If separator is in the string, then the result is a pair (LHS, RHS) such that (str == LHS + separator + RHS) is true and RHS is maximal. If separator is not in the string, then the result is a pair (LHS, RHS) where (str == LHS) and (RHS == "").

Parameters
separatorThe string to split on.
Returns
The split substrings.

◆ starts_with() [1/3]

bool wpi::starts_with ( std::string_view str,
char prefix )
constexprnoexcept

Checks if str starts with the given prefix.

◆ starts_with() [2/3]

bool wpi::starts_with ( std::string_view str,
const char * prefix )
constexprnoexcept

Checks if str starts with the given prefix.

◆ starts_with() [3/3]

bool wpi::starts_with ( std::string_view str,
std::string_view prefix )
constexprnoexcept

Checks if str starts with the given prefix.

◆ starts_with_lower() [1/3]

bool wpi::starts_with_lower ( std::string_view str,
char prefix )
constexprnoexcept

Checks if str starts with the given prefix, ignoring case.

◆ starts_with_lower() [2/3]

bool wpi::starts_with_lower ( std::string_view str,
const char * prefix )
inlinenoexcept

Checks if str starts with the given prefix, ignoring case.

◆ starts_with_lower() [3/3]

bool wpi::starts_with_lower ( std::string_view str,
std::string_view prefix )
noexcept

Checks if str starts with the given prefix, ignoring case.

◆ SubOverflow()

template<typename T >
std::enable_if_t< std::is_signed_v< T >, T > wpi::SubOverflow ( T X,
T Y,
T & Result )

Subtract two signed integers, computing the two's complement truncated result, returning true if an overflow ocurred.

◆ substr()

std::string_view wpi::substr ( std::string_view str,
std::string_view::size_type start,
std::string_view::size_type n = std::string_view::npos )
constexprnoexcept

Returns the substring of str from [start, start + n).

Parameters
startThe index of the starting character in the substring; if the index is npos or greater than the length of the string then the empty substring will be returned.
nThe number of characters to included in the substring. If n exceeds the number of characters remaining in the string, the string suffix (starting with start) will be returned.

◆ swap()

template<class T , class E , detail_expected::enable_if_t<(std::is_void< T >::value||std::is_move_constructible< T >::value) &&detail_expected::is_swappable< T >::value &&std::is_move_constructible< E >::value &&detail_expected::is_swappable< E >::value > * = nullptr>
void wpi::swap ( expected< T, E > & lhs,
expected< T, E > & rhs )
noexcept

◆ take_back() [1/2]

template<typename T , size_t N>
std::span< T > wpi::take_back ( std::span< T, N > in,
typename std::span< T >::size_type n = 1 )
constexpr

Returns a span equal to in but with only the last n elements remaining.

If n is greater than the length of the span, the entire span is returned.

◆ take_back() [2/2]

std::string_view wpi::take_back ( std::string_view str,
std::string_view::size_type n = 1 )
constexprnoexcept

Returns a view equal to str but with only the last n elements remaining.

If n is greater than the length of the string, the entire string is returned.

◆ take_front() [1/2]

template<typename T , size_t N>
std::span< T > wpi::take_front ( std::span< T, N > in,
typename std::span< T >::size_type n = 1 )
constexpr

Returns a span equal to in but with only the first n elements remaining.

If n is greater than the length of the span, the entire span is returned.

◆ take_front() [2/2]

std::string_view wpi::take_front ( std::string_view str,
std::string_view::size_type n = 1 )
constexprnoexcept

Returns a view equal to str but with only the first n elements remaining.

If n is greater than the length of the string, the entire string is returned.

◆ to_string_view()

std::string_view wpi::to_string_view ( const struct WPI_String * str)
constexpr

Converts a WPI_String to a string_view.

◆ to_underlying()

template<typename Enum >
std::underlying_type_t< Enum > wpi::to_underlying ( Enum E)
nodiscardconstexpr

Returns underlying integer value of an enum.

Backport of C++23 std::to_underlying.

◆ to_vector() [1/2]

template<unsigned Size, typename R >
SmallVector< ValueTypeFromRangeType< R >, Size > wpi::to_vector ( R && Range)

Given a range of type R, iterate the entire range and return a SmallVector with elements of the vector.

This is useful, for example, when you want to iterate a range and then sort the results.

◆ to_vector() [2/2]

template<typename R >
SmallVector< ValueTypeFromRangeType< R > > wpi::to_vector ( R && Range)

◆ to_vector_of() [1/2]

template<typename Out , unsigned Size, typename R >
SmallVector< Out, Size > wpi::to_vector_of ( R && Range)

◆ to_vector_of() [2/2]

template<typename Out , typename R >
SmallVector< Out > wpi::to_vector_of ( R && Range)

◆ toLower()

char wpi::toLower ( char x)
constexprnoexcept

Returns the corresponding lowercase character if x is uppercase.

◆ toUpper()

char wpi::toUpper ( char x)
constexprnoexcept

Returns the corresponding uppercase character if x is lowercase.

◆ transformOptional() [1/2]

template<typename T , typename Function >
auto wpi::transformOptional ( const std::optional< T > & O,
const Function & F ) -> std::optional<decltype(F(*O))>

◆ transformOptional() [2/2]

template<typename T , typename Function >
auto wpi::transformOptional ( std::optional< T > && O,
const Function & F ) -> std::optional<decltype(F(*std::move(O)))>

◆ trim() [1/2]

std::string_view wpi::trim ( std::string_view str,
char ch )
constexprnoexcept

Returns str with consecutive ch characters starting from the left and right removed.

◆ trim() [2/2]

std::string_view wpi::trim ( std::string_view str,
std::string_view chars = " \t\n\v\f\r" )
constexprnoexcept

Returns str with consecutive characters in chars starting from the left and right removed.

◆ UnescapeCString()

std::pair< std::string_view, std::string_view > wpi::UnescapeCString ( std::string_view str,
SmallVectorImpl< char > & buf )

Unescapes a C-style string (reverse operation to raw_ostream::write_escaped).

Scans through str until either the end is reached or an unescaped double quote character is found.

Parameters
strinput string
bufbuffer for unescaped characters
Returns
pair of the unescaped string and any remaining input

◆ UnescapeURI()

std::string_view wpi::UnescapeURI ( std::string_view str,
SmallVectorImpl< char > & buf,
bool * error )

◆ unique_dyn_cast() [1/2]

template<class X , class Y >
auto wpi::unique_dyn_cast ( std::unique_ptr< Y > && Val)
inlinenodiscard

◆ unique_dyn_cast() [2/2]

template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType wpi::unique_dyn_cast ( std::unique_ptr< Y > & Val)
inlinenodiscard

unique_dyn_cast<X> - Given a unique_ptr<Y>, try to return a unique_ptr<X>, taking ownership of the input pointer iff isa<X>(Val) is true.

If the cast is successful, From refers to nullptr on exit and the casted value is returned. If the cast is unsuccessful, the function returns nullptr and From is unchanged.

◆ unique_dyn_cast_or_null() [1/2]

template<class X , class Y >
auto wpi::unique_dyn_cast_or_null ( std::unique_ptr< Y > && Val)
inlinenodiscard

◆ unique_dyn_cast_or_null() [2/2]

template<class X , class Y >
CastInfo< X, std::unique_ptr< Y > >::CastResultType wpi::unique_dyn_cast_or_null ( std::unique_ptr< Y > & Val)
inlinenodiscard

◆ UnpackStruct() [1/2]

template<typename T , typename... I>
requires StructSerializable<T, I...>
T wpi::UnpackStruct ( std::span< const uint8_t > data,
const I &... info )
inline

Unpack a serialized struct.

Template Parameters
Tobject type
Parameters
dataraw struct data
infooptional struct type info
Returns
Deserialized object

◆ UnpackStruct() [2/2]

template<typename T , size_t Offset, typename... I>
requires StructSerializable<T, I...>
T wpi::UnpackStruct ( std::span< const uint8_t > data,
const I &... info )
inline

Unpack a serialized struct starting at a given offset within the data.

This is primarily useful in unpack implementations to unpack nested structs.

Template Parameters
Tobject type
Offsetstarting offset
Parameters
dataraw struct data
infooptional struct type info
Returns
Deserialized object

◆ UnpackStructArray()

template<StructSerializable T, size_t Offset, size_t N>
wpi::array< T, N > wpi::UnpackStructArray ( std::span< const uint8_t > data)
inline

Unpack a serialized struct array starting at a given offset within the data.

This is primarily useful in unpack implementations to unpack nested struct arrays.

Template Parameters
Tobject type
Offsetstarting offset
Nnumber of objects
Parameters
dataraw struct data
Returns
Deserialized array

◆ UnpackStructInto() [1/2]

template<typename T , typename... I>
requires StructSerializable<T, I...>
void wpi::UnpackStructInto ( T * out,
std::span< const uint8_t > data,
const I &... info )
inline

Unpack a serialized struct into an existing object, overwriting its contents.

Parameters
outobject (output)
dataraw struct data
infooptional struct type info

◆ UnpackStructInto() [2/2]

template<size_t Offset, typename T , typename... I>
requires StructSerializable<T, I...>
void wpi::UnpackStructInto ( T * out,
std::span< const uint8_t > data,
const I &... info )
inline

Unpack a serialized struct into an existing object, overwriting its contents, and starting at a given offset within the data.

This is primarily useful in unpack implementations to unpack nested structs.

Template Parameters
Offsetstarting offset
Parameters
outobject (output)
dataraw struct data
infooptional struct type info

◆ utohexstr()

std::string wpi::utohexstr ( unsigned long long val,
bool lowerCase = false )
inline

◆ vprint()

void wpi::vprint ( wpi::raw_ostream & os,
fmt::string_view format_str,
fmt::format_args args )
inline

◆ WaitForObject() [1/2]

bool wpi::WaitForObject ( WPI_Handle handle)

Waits for an handle to be signaled.

Parameters
handlehandle to wait on
Returns
True if handle was signaled, false otherwise (e.g. object was destroyed)

◆ WaitForObject() [2/2]

bool wpi::WaitForObject ( WPI_Handle handle,
double timeout,
bool * timedOut )

Waits for an handle to be signaled, with timeout.

Parameters
handlehandle to wait on
timeouttimeout in seconds
timedOutif non-null, set to true if timeout reached without handle being signaled; set to false otherwise (output)
Returns
True if handle was signaled, false otherwise (e.g. object was destroyed or timed out)

◆ WaitForObjects() [1/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::initializer_list< WPI_Handle > handles,
std::span< WPI_Handle > signaled )
inline

Waits for one or more handles to be signaled.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
Returns
array of signaled handles (points into signaled array)

◆ WaitForObjects() [2/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::initializer_list< WPI_Handle > handles,
std::span< WPI_Handle > signaled,
double timeout,
bool * timedOut )
inline

Waits for one or more handles to be signaled, with timeout.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
timeouttimeout in seconds
timedOutif non-null, set to true if timeout reached without any handle being signaled; set to false otherwise (output)
Returns
array of signaled handles (points into signaled array)

◆ WaitForObjects() [3/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::span< const WPI_Handle > handles,
std::span< WPI_Handle > signaled )

Waits for one or more handles to be signaled.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
Returns
array of signaled handles (points into signaled array)

◆ WaitForObjects() [4/4]

std::span< WPI_Handle > wpi::WaitForObjects ( std::span< const WPI_Handle > handles,
std::span< WPI_Handle > signaled,
double timeout,
bool * timedOut )

Waits for one or more handles to be signaled, with timeout.

Invalid handles are treated as signaled; the returned array will have the handle error bit set for any invalid handles.

Parameters
handlesarray of handles to wait on
signaledoutput array for storage of signaled handles; must be at least the size of the handles input array
timeouttimeout in seconds
timedOutif non-null, set to true if timeout reached without any handle being signaled; set to false otherwise (output)
Returns
array of signaled handles (points into signaled array)

◆ wpi_unreachable_internal()

void wpi::wpi_unreachable_internal ( const char * msg = nullptr,
const char * file = nullptr,
unsigned line = 0 )

This function calls abort(), and prints the optional message to stderr.

Use the wpi_unreachable macro (that adds location info), instead of calling this function directly.

◆ WriteUleb128() [1/2]

void wpi::WriteUleb128 ( raw_ostream & os,
uint64_t val )

Write unsigned LEB128 data.

Encode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data".

Parameters
osOutput stream.
valValue to be stored.

◆ WriteUleb128() [2/2]

uint64_t wpi::WriteUleb128 ( SmallVectorImpl< char > & dest,
uint64_t val )

Write unsigned LEB128 data.

Encode an unsigned LEB128 encoded datum. The algorithm is taken from Appendix C of the DWARF 3 spec. For information on the encodings refer to section "7.6 - Variable Length Data". Return the number of bytes written.

Parameters
destThe address where the ULEB128 data is to be stored.
valValue to be stored.

◆ xxh3_128bits()

XXH128_hash_t wpi::xxh3_128bits ( std::span< const uint8_t > data)

XXH3's 128-bit variant.

◆ xxh3_64bits() [1/2]

uint64_t wpi::xxh3_64bits ( std::span< const uint8_t > data)

◆ xxh3_64bits() [2/2]

uint64_t wpi::xxh3_64bits ( std::string_view data)
inline

◆ xxHash64() [1/2]

uint64_t wpi::xxHash64 ( std::span< const uint8_t > Data)

◆ xxHash64() [2/2]

uint64_t wpi::xxHash64 ( std::string_view Data)

Variable Documentation

◆ BitReverseTable256

const unsigned char wpi::BitReverseTable256[256]
static
Initial value:
= {
#define R2(n)
#define R4(n)
#define R6(n)
R6(0), R6(2), R6(1), R6(3)
}
#define R6(n)

Macro compressed bit reversal table for 256 bits.

http://graphics.stanford.edu/~seander/bithacks.html#BitReverseTable

◆ empty_array

empty_array_t wpi::empty_array
constexpr

◆ huge_valf

const float wpi::huge_valf
extern

Use this rather than HUGE_VALF; the latter causes warnings on MSVC.

◆ in_place

in_place_t wpi::in_place {}
staticconstexpr

◆ IsaAndPresentPred

template<typename... Types>
detail::IsaAndPresentCheckPredicate<Types...> wpi::IsaAndPresentPred {}
inlineconstexpr

Function object wrapper for the wpi::isa_and_present type check.

The function call operator returns true when the value can be cast to any type in Types, or if the value is not present (e.g., nullptr). Example:

SmallVector<Type> myTypes = ...;
if (wpi::all_of(myTypes, wpi::IsaAndPresentPred<VectorType>))
...
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Definition SmallVector.h:1212
constexpr detail::IsaAndPresentCheckPredicate< Types... > IsaAndPresentPred
Function object wrapper for the wpi::isa_and_present type check.
Definition Casting.h:848

◆ IsaPred

template<typename... Types>
detail::IsaCheckPredicate<Types...> wpi::IsaPred {}
inlineconstexpr

Function object wrapper for the wpi::isa type check.

The function call operator returns true when the value can be cast to any type in Types. Example:

SmallVector<Type> myTypes = ...;
if (wpi::all_of(myTypes, wpi::IsaPred<VectorType>))
...
constexpr detail::IsaCheckPredicate< Types... > IsaPred
Function object wrapper for the wpi::isa type check.
Definition Casting.h:836

◆ IsNullable

template<typename T >
bool wpi::IsNullable
constexpr
Initial value:
=
std::is_pointer_v<T> || std::is_constructible_v<T, std::nullptr_t>

◆ kHandleTypeCSBase

int wpi::kHandleTypeCSBase = 3
constexpr

◆ kHandleTypeEvent

int wpi::kHandleTypeEvent = 1
constexpr

Standard types for handles.

◆ kHandleTypeHALBase

int wpi::kHandleTypeHALBase = 48
constexpr

◆ kHandleTypeNTBase

int wpi::kHandleTypeNTBase = 16
constexpr

◆ kHandleTypeSemaphore

int wpi::kHandleTypeSemaphore = 2
constexpr

◆ kHandleTypeUserBase

int wpi::kHandleTypeUserBase = 80
constexpr

◆ kInvalidHandle

unsigned int wpi::kInvalidHandle = 0
constexpr

Constant representing an invalid handle.

◆ SmallVector

template<typename T , unsigned N>
class LLVM_GSL_OWNER wpi::SmallVector

Forward declaration of SmallVector so that calculateSmallVectorDefaultInlinedElements can reference sizeof(SmallVector<T, 0>).

◆ unexpect

unexpect_t wpi::unexpect {}
staticconstexpr