DotNetDupe 4.0.6
C++17/20 Implementation of the .NET Base Class Library (BCL)
Loading...
Searching...
No Matches
DotNetDupe::System Namespace Reference

Namespaces

namespace  Collections
namespace  ComponentModel
namespace  Data
namespace  Diagnostics
namespace  IdentityModel
namespace  Internal
namespace  IO
namespace  Net
namespace  Security
namespace  Text
namespace  Threading
namespace  Utils

Classes

class  Action
 Encapsulates a method that has parameters and does not return a value. More...
class  Action< Arg1, Args... >
class  Action<>
class  AggregateException
 Represents one or more errors that occur during application execution. More...
class  ArgumentException
 The exception that is thrown when one of the arguments provided to a method is not valid. More...
class  ArgumentNullException
 The exception that is thrown when a null reference is passed to a method that does not accept it as a valid argument. More...
class  ArgumentOutOfRangeException
 The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. More...
class  ArithmeticException
 The exception that is thrown for errors in an arithmetic, casting, or conversion operation. More...
class  Array
 Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime. More...
class  BitConverter
 Converts base data types to arrays of bytes, and vice versa. More...
struct  BoolRepresentation
struct  BoolRepresentationWChar
class  Buffer
 Manipulates arrays of primitive types efficiently at the byte level. More...
struct  CaseInsensitiveCompare
 Helper for portable ASCII case-insensitive comparison. More...
struct  CaseInsensitiveCompareWChar
 Helper for portable wide-character case-insensitive comparison. More...
class  Char
 Represents a Unicode character (as a UTF-32 char32_t code point). More...
class  Console
 Represents the standard input, output, and error streams for console applications. More...
class  Convert
 Converts a base data type to another base data type. More...
class  DateTime
 Represents an instant in time, typically expressed as a date and time of day. More...
class  DateTimeOffset
 Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC). More...
class  DaylightTime
 Defines the period of daylight saving time for a region. More...
class  EnableSharedFromThis
class  EnableSharedFromThisBase
class  Environment
 Provides environment variables, machine info, hardware traits, and platform properties. More...
class  EventArgs
 Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data. More...
class  EventHandler
 Represents the method that will handle an event when the event provides data. More...
class  Exception
 Represents errors that occur during application execution. More...
class  FormatException
 The exception that is thrown when the format of an argument is invalid, or when a composite format string is not well formed. More...
struct  FormatExceptionMessage
struct  FormatExceptionMessageWChar
class  Func
 Primary template declaration for the Func delegate family. More...
class  Func< TResult >
 Encapsulates a method that has no parameters and returns a value of type TResult. More...
class  Func< TResult, Arg1, Args... >
class  GenericUriParser
 A customizable parser for a hierarchical URI. More...
class  Guid
 Represents a 128-bit globally unique identifier (GUID). More...
struct  HashHelper
 Primary template for generating 32-bit hash codes from arbitrary types using byte-level folding. More...
struct  HashHelper< bool >
struct  HashHelper< char >
struct  HashHelper< int >
struct  HashHelper< long long >
struct  HashHelper< short >
struct  HashHelper< SmartPointer< T > >
struct  HashHelper< String >
struct  HashHelper< T * >
struct  HashHelper< unsigned char >
struct  HashHelper< unsigned int >
struct  HashHelper< unsigned long long >
struct  HashHelper< unsigned short >
struct  HashHelper< wchar_t >
interface  IClonable
 Supports cloning, which creates a new instance of a class with the same value as an existing instance. More...
interface  IComparable
 Defines a generalized type-specific comparison method that a value type or class implements to order or sort its instances. More...
interface  IFormatProvider
 Provides a mechanism for retrieving an object to control formatting. More...
class  InvalidOperationException
 The exception that is thrown when a method call is invalid for the object's current state. More...
struct  IsComplete
struct  IsComplete< T, std::void_t< decltype(sizeof(T))> >
class  IServiceProvider
 Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. More...
class  NotImplementedException
 The exception that is thrown when a requested method or operation is not implemented. More...
class  NotSupportedException
 The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the related functionality. More...
class  NullReferenceException
 The exception that is thrown when there is an attempt to dereference a null object reference. More...
class  Object
 Supports all classes in the DotNetDupe class hierarchy. More...
class  ObjectDisposedException
 The exception that is thrown when an operation is performed on a disposed object. More...
class  OperatingSystem
 Represents information about an operating system, such as the version and platform identifier. More...
class  OperationCanceledException
 The exception that is thrown in a thread upon cancellation of an operation that the thread was executing. More...
class  OutOfMemoryException
 The exception that is thrown when there is not enough memory to continue execution. More...
class  OverflowException
 The exception that is thrown when an arithmetic, casting, or conversion operation in a checked context results in an overflow. More...
class  PlatformNotSupportedException
 The exception that is thrown when a feature does not run on a particular platform. More...
class  Predicate
 Represents the method that defines a set of criteria and determines whether the specified object meets those criteria. More...
class  Random
 Represents a pseudo-random number generator, which is an algorithm that produces a sequence of numbers that meet certain statistical requirements for randomness. More...
class  SmartPointer
 A unified smart pointer that supports both unique and shared ownership semantics. More...
class  String
 Represents text as a sequence of UTF-8 code units with culture-invariant operations. More...
class  SystemException
 Serves as the base class for system exceptions namespace. More...
class  TimeoutException
 The exception that is thrown when the time allotted for a process or operation has expired. More...
class  TimeProvider
 An abstraction that provides time-related functions to enable testability of time-dependent code. More...
class  TimeSpan
 Represents a time interval (duration of time or elapsed time) measured as a positive or negative number of ticks. More...
class  TimeZone
 Represents a time zone and handles time zone conversions. More...
class  TimeZoneInfo
 Represents any time zone in the world. More...
class  UnauthorizedAccessException
 The exception that is thrown when the operating system denies access because of an I/O or security error. More...
class  UnknownException
 Represents an unknown or unmapped exception encountered during execution. More...
class  Uri
 Represents an object representation of a Uniform Resource Identifier (URI) and provides easy access to the parts of the URI. More...
class  UriBuilder
 Provides a custom constructor for uniform resource identifiers (URIs) and modifies URIs for the Uri class. More...
class  UriParser
 Parses a new URI scheme and provides scheme-specific component extraction. More...
class  Version
 Represents the version number for an assembly, operating system, or component. More...

Typedefs

using byte = unsigned char
using TimeProviderPtr = SmartPointer<TimeProvider>
 Alias for a smart pointer to a TimeProvider.

Enumerations

enum class  ConsoleColor {
  Black = 0 , DarkBlue = 1 , DarkGreen = 2 , DarkCyan = 3 ,
  DarkRed = 4 , DarkMagenta = 5 , DarkYellow = 6 , Gray = 7 ,
  DarkGray = 8 , Blue = 9 , Green = 10 , Cyan = 11 ,
  Red = 12 , Magenta = 13 , Yellow = 14 , White = 15
}
 Specifies constants that define foreground and background colors for the console. More...
enum class  DateTimeKind { Unspecified = 0 , Utc = 1 , Local = 2 }
 Specifies whether a DateTime object represents local time, UTC, or is unspecified. More...
enum class  PlatformID {
  Win32S = 0 , Win32Windows = 1 , Win32NT = 2 , WinCE = 3 ,
  Unix = 4 , Xbox = 5
}
 Identifies the operating system, or platform, supported by an assembly. More...
enum class  StringSplitOptions { None , RemoveEmptyEntries , TrimEntries }
 Specifies whether applicable Overload:Split methods include or omit empty substrings. More...
enum class  UriComponents {
  Scheme = 1 , UserInfo = 2 , Host = 4 , Port = 8 ,
  Path = 16 , Query = 32 , Fragment = 64 , StrongPort = 128 ,
  NormalizedHost = 256 , KeepDelimiter = 1073741824 , AbsoluteUri = 32767 , PathAndQuery = 48 ,
  SchemeAndServer = 13 , HttpRequestUrl = 61 , UriPath = 50 , HostAndPort = 12 ,
  UserInfoAndHostAndPort = 15 , SafeUnescaped = 8191
}
 Specifies the parts of a Uniform Resource Identifier (URI) to return. More...
enum class  UriFormat { UriEscaped = 1 , Unescaped = 2 , SafeUnescaped = 3 }
 Controls character escaping and normalization during URI component extraction. More...

Functions

static void AddSplitToken (const std::string &sCurrent, StringSplitOptions eOptions, std::vector< String > &vResult)
void * AllocateCollectionBuffer (size_t size)
 Internal memory allocator for generic collections.
static void AppendAuthority (std::string &result, const String &host, const String &user, const String &pass, int port)
static void AppendExplicitArg (const std::string &sFmt, size_t i, size_t end, const String *pArgs, int iArgCount, std::string &sRes)
static void AppendPathAndQuery (std::string &result, const String &path, const String &query, const String &fragment)
template<typename Target, typename Source>
static Target CheckRange (Source value)
template<typename To, typename From>
SmartPointer< To > ConstPointerCast (const SmartPointer< From > &sp)
static std::string ConvertFormat (const String &format)
static struct tm ConvertToLocalTm (int64_t time)
static struct tm ConvertToUtcTm (int64_t time)
static int64_t DateToTicks (int year, int month, int day)
 Converts a Gregorian calendar date into total 100-nanosecond ticks since CE 0001-01-01.
static void DecodeBase64Chunk4 (unsigned char *char_array_4, std::vector< char > &decoded)
static void DecodeBase64Loop (const std::string &sInput, std::vector< char > &decoded)
static void DecodeBase64Remainder (unsigned char *char_array_4, int i, std::vector< char > &decoded)
template<typename To, typename From>
SmartPointer< To > DynamicCast (const SmartPointer< From > &sp)
template<typename To, typename From>
SmartPointer< To > DynamicPointerCast (const SmartPointer< From > &sp)
static void EncodeBase64Chunk4 (const unsigned char *char_array_3, std::string &ret)
static void EncodeBase64Remainder (unsigned char *char_array_3, int remainderLen, std::string &ret)
template<typename TEventArgs = EventArgs>
 EventHandler () -> EventHandler< TEventArgs >
static int FindLastCharIndex (const std::string &s, int iStartIndex, char ch, bool bIgnoreCase)
static void FormatClosingBrace (const std::string &sFmt, size_t &i, std::string &sRes)
static void FormatOpenBrace (const std::string &sFmt, size_t &i, int &iAutoIndex, const String *pArgs, int iArgCount, std::string &sRes)
void FreeCollectionBuffer (void *p)
 Frees collection buffer allocated with AllocateCollectionBuffer.
static int GetCsidlForFolder (Environment::SpecialFolder eFolder)
static void GetDatePart (int64_t ticks, int &year, int &month, int &day)
 Decomposes total ticks into Gregorian calendar date components (year, month, day).
static bool IsBase64 (unsigned char c)
String operator+ (char ch, const String &sStr)
String operator+ (const char *pStr, const String &sStr)
static void ParseAndAddEnvEntry (const String &sLine, Collections::Generic::Dictionary< String, String > &result)
static void ParseAuthorityComponents (const String &authority, const String &scheme, String &userInfo, String &host, int &port)
static bool ParseComponent (const std::string &sPart, int &iVal)
static bool ParseDateTimeStr (const String &s, const String &format, DateTime &result)
static void ParsePath (const std::string &rawUri, const String &scheme, String &path)
static void ParseQueryAndFragment (const std::string &rawUri, String &query, String &fragment)
static void ParseSchemeAndAuthority (const std::string &rawUri, String &scheme, String &authority)
static std::set< char > PopulateSplitCharSet (const String *pSeparator, int iCount)
static std::vector< StringReadCommandLineTokens ()
static std::vector< StringSplitByCharSet (const std::string &sText, const std::set< char > &charSet, StringSplitOptions eOptions)
static bool SplitVersionParts (const String &sInput, std::vector< std::string > &vecParts)
template<typename To, typename From>
SmartPointer< To > StaticCast (const SmartPointer< From > &sp)
template<typename To, typename From>
SmartPointer< To > StaticPointerCast (const SmartPointer< From > &sp)
void ThrowArgumentException (const char *msg)
void ThrowFormatException (const char *msg)
static int64_t TimeToTicks (int hour, int minute, int second)
 Converts hour, minute, and second into total 100-nanosecond ticks.
static int64_t TmToTicks (const struct tm &t, int64_t remainderTicks)
static String ToBaseString (unsigned long long llValue, int iToBase)
static std::string ToLowerString (const std::string &s)
static bool TryParseInternal (const String &sInput, int &iMajor, int &iMinor, int &iBuild, int &iRevision, int &iCount)
static void UnescapePercentChar (const std::string &s, size_t &i, std::string &unescaped)

Variables

static const char base64_chars []
constexpr int DaysToMonth365 [] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }
constexpr int DaysToMonth366 [] = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
constexpr int64_t MaxTicks = 3155378975999999999LL
constexpr int64_t MinTicks = 0
constexpr int64_t TicksPerDay = TicksPerHour * 24
constexpr int64_t TicksPerHour = TicksPerMinute * 60
constexpr int64_t TicksPerMillisecond = 10000
constexpr int64_t TicksPerMinute = TicksPerSecond * 60
constexpr int64_t TicksPerSecond = TicksPerMillisecond * 1000
constexpr int64_t UnixEpochTicks = 621355968000000000LL

Typedef Documentation

◆ byte

using DotNetDupe::System::byte = unsigned char

Definition at line 18 of file Buffer.h.

◆ TimeProviderPtr

Alias for a smart pointer to a TimeProvider.

Definition at line 21 of file TimeProvider.h.

Enumeration Type Documentation

◆ ConsoleColor

Specifies constants that define foreground and background colors for the console.

Enumerator
Black 
DarkBlue 
DarkGreen 
DarkCyan 
DarkRed 
DarkMagenta 
DarkYellow 
Gray 
DarkGray 
Blue 
Green 
Cyan 
Red 
Magenta 
Yellow 
White 

Definition at line 23 of file Console.h.

◆ DateTimeKind

Specifies whether a DateTime object represents local time, UTC, or is unspecified.

Enumerator
Unspecified 

The time represented is not specified as either local time or UTC.

Utc 

The time represented is UTC.

Local 

The time represented is local time.

Definition at line 19 of file DateTime.h.

◆ PlatformID

enum class DotNetDupe::System::PlatformID
strong

Identifies the operating system, or platform, supported by an assembly.

Enumerator
Win32S 

Win32s operating system.

Win32Windows 

Windows 95, Windows 98, or Windows Me.

Win32NT 

Windows NT, 2000, XP, Vista, 7, 8, 10, 11, or Windows Server.

WinCE 

Windows CE.

Unix 

Unix or Linux platform.

Xbox 

Xbox platform.

Definition at line 19 of file OperatingSystem.h.

◆ StringSplitOptions

Specifies whether applicable Overload:Split methods include or omit empty substrings.

Enumerator
None 

Include empty substrings in the returned array.

RemoveEmptyEntries 

Omit substrings that contain an empty string from the array.

TrimEntries 

Trim white-space characters from each element in the array.

Definition at line 25 of file String.h.

◆ UriComponents

Specifies the parts of a Uniform Resource Identifier (URI) to return.

Modeled after .NET System.UriComponents and compliant with RFC 3986. Allows bitwise composition of URI subcomponents for parsing and reconstruction.

Enumerator
Scheme 

The scheme component (e.g., "http", "https", "ftp").

UserInfo 

User name and password authorization data.

Host 

Domain name or IP address.

Port 

Network port number.

Path 

Resource path component.

Query 

Query string starting after the question mark.

Fragment 

Fragment identifier starting after the hash character.

StrongPort 

The port number, including explicit default port numbers.

NormalizedHost 

Canonicalized host name.

KeepDelimiter 

Preserves component delimiter character.

AbsoluteUri 

Complete canonical URI string.

PathAndQuery 

Path and query components combined.

SchemeAndServer 

Scheme, host, and port combined.

HttpRequestUrl 

Full HTTP URL without user credentials or fragment.

UriPath 

Scheme, authority, and path combined.

HostAndPort 

Host and port combined.

UserInfoAndHostAndPort 

UserInfo, host, and port combined.

SafeUnescaped 

Safe unescaped characters preserved.

Definition at line 16 of file UriEnums.h.

◆ UriFormat

enum class DotNetDupe::System::UriFormat
strong

Controls character escaping and normalization during URI component extraction.

Modeled after .NET System.UriFormat.

Enumerator
UriEscaped 

Characters are percent-escaped according to RFC 3986 rules.

Unescaped 

Characters are unescaped to their literal character values.

SafeUnescaped 

Reserved characters remain escaped, while unreserved are unescaped.

Definition at line 41 of file UriEnums.h.

Function Documentation

◆ AddSplitToken()

void DotNetDupe::System::AddSplitToken ( const std::string & sCurrent,
StringSplitOptions eOptions,
std::vector< String > & vResult )
static

◆ AllocateCollectionBuffer()

void * DotNetDupe::System::AllocateCollectionBuffer ( size_t size)

Internal memory allocator for generic collections.

Parameters
sizeNumber of bytes to allocate.
Returns
Allocated memory pointer.

Route directly to global operator new for aligned collection buffer allocation.

Definition at line 39 of file Object.cpp.

References AllocateCollectionBuffer(), and DOTNETDUPE_API.

Referenced by AllocateCollectionBuffer(), DotNetDupe::System::Collections::Generic::LinkedListNode< T >::operator new(), and DotNetDupe::System::Collections::Generic::List< T >::SetCapacity().

◆ AppendAuthority()

void DotNetDupe::System::AppendAuthority ( std::string & result,
const String & host,
const String & user,
const String & pass,
int port )
static

Guard: Do not append authority if host is empty.

Step: Append credentials if present.

Step: Append host and optional custom port.

Definition at line 50 of file UriBuilder.cpp.

References AppendAuthority(), and DotNetDupe::System::String::IsEmpty().

Referenced by AppendAuthority(), and DotNetDupe::System::UriBuilder::ToString().

◆ AppendExplicitArg()

void DotNetDupe::System::AppendExplicitArg ( const std::string & sFmt,
size_t i,
size_t end,
const String * pArgs,
int iArgCount,
std::string & sRes )
static

Extract integer argument index between placeholder braces {N}.

Append resolved string argument to target buffer.

Definition at line 67 of file String.cpp.

References DotNetDupe::System::FormatException::FormatException(), AppendExplicitArg(), and DotNetDupe::System::String::GetRawString().

Referenced by AppendExplicitArg(), and FormatOpenBrace().

◆ AppendPathAndQuery()

void DotNetDupe::System::AppendPathAndQuery ( std::string & result,
const String & path,
const String & query,
const String & fragment )
static

Step: Append path with leading slash delimiter.

Step: Append query with leading question mark delimiter.

Step: Append fragment with leading hash delimiter.

Definition at line 71 of file UriBuilder.cpp.

References AppendPathAndQuery(), and DotNetDupe::System::String::IsEmpty().

Referenced by AppendPathAndQuery(), and DotNetDupe::System::UriBuilder::ToString().

◆ CheckRange()

template<typename Target, typename Source>
Target DotNetDupe::System::CheckRange ( Source value)
static

◆ ConstPointerCast()

template<typename To, typename From>
SmartPointer< To > DotNetDupe::System::ConstPointerCast ( const SmartPointer< From > & sp)
inline

Definition at line 585 of file SmartPointer.h.

References ConstPointerCast().

Referenced by ConstPointerCast().

◆ ConvertFormat()

std::string DotNetDupe::System::ConvertFormat ( const String & format)
static

Convert .NET DateTime format specifiers to strftime format specifiers.

Definition at line 354 of file DateTime.cpp.

References ConvertFormat(), and DotNetDupe::System::String::GetRawString().

Referenced by ConvertFormat(), and ParseDateTimeStr().

◆ ConvertToLocalTm()

struct tm DotNetDupe::System::ConvertToLocalTm ( int64_t time)
static

Convert POSIX timestamp to thread-safe local calendar struct.

Definition at line 273 of file DateTime.cpp.

References ConvertToLocalTm().

Referenced by ConvertToLocalTm(), and DotNetDupe::System::DateTime::ToLocalTime().

◆ ConvertToUtcTm()

struct tm DotNetDupe::System::ConvertToUtcTm ( int64_t time)
static

Convert POSIX timestamp to thread-safe UTC calendar struct.

Definition at line 285 of file DateTime.cpp.

References ConvertToUtcTm().

Referenced by ConvertToUtcTm(), and DotNetDupe::System::DateTime::ToUniversalTime().

◆ DateToTicks()

int64_t DotNetDupe::System::DateToTicks ( int year,
int month,
int day )
static

Converts a Gregorian calendar date into total 100-nanosecond ticks since CE 0001-01-01.

Guard: Validate Gregorian calendar range.

Guard: Validate day count within month bounds.

Compute cumulative days according to 400-year Gregorian leap cycle.

Scale days to ticks.

Definition at line 29 of file DateTime.cpp.

References DotNetDupe::System::ArgumentOutOfRangeException::ArgumentOutOfRangeException(), DateToTicks(), DaysToMonth365, DaysToMonth366, DotNetDupe::System::DateTime::IsLeapYear(), and TicksPerDay.

Referenced by DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::AddMonths(), DateToTicks(), and TmToTicks().

◆ DecodeBase64Chunk4()

void DotNetDupe::System::DecodeBase64Chunk4 ( unsigned char * char_array_4,
std::vector< char > & decoded )
static

◆ DecodeBase64Loop()

void DotNetDupe::System::DecodeBase64Loop ( const std::string & sInput,
std::vector< char > & decoded )
static

Stream 4-character 6-bit Base64 blocks and decode into 3-byte groups.

Process any trailing non-padded remainder characters.

Definition at line 371 of file Convert.cpp.

References DecodeBase64Chunk4(), DecodeBase64Loop(), DecodeBase64Remainder(), and IsBase64().

Referenced by DecodeBase64Loop(), and DotNetDupe::System::Convert::FromBase64String().

◆ DecodeBase64Remainder()

void DotNetDupe::System::DecodeBase64Remainder ( unsigned char * char_array_4,
int i,
std::vector< char > & decoded )
static

Map remainder Base64 characters to 6-bit numerical values.

Unpack 6-bit values into 1 or 2 trailing raw bytes.

Definition at line 351 of file Convert.cpp.

References DotNetDupe::System::ArgumentException::ArgumentException(), base64_chars, and DecodeBase64Remainder().

Referenced by DecodeBase64Loop(), and DecodeBase64Remainder().

◆ DynamicCast()

template<typename To, typename From>
SmartPointer< To > DotNetDupe::System::DynamicCast ( const SmartPointer< From > & sp)
inline

◆ DynamicPointerCast()

template<typename To, typename From>
SmartPointer< To > DotNetDupe::System::DynamicPointerCast ( const SmartPointer< From > & sp)
inline

Definition at line 575 of file SmartPointer.h.

References DynamicCast(), and DynamicPointerCast().

Referenced by DynamicPointerCast().

◆ EncodeBase64Chunk4()

void DotNetDupe::System::EncodeBase64Chunk4 ( const unsigned char * char_array_3,
std::string & ret )
static

◆ EncodeBase64Remainder()

void DotNetDupe::System::EncodeBase64Remainder ( unsigned char * char_array_3,
int remainderLen,
std::string & ret )
static

◆ EventHandler()

template<typename TEventArgs = EventArgs>
DotNetDupe::System::EventHandler ( ) -> EventHandler< TEventArgs >

◆ FindLastCharIndex()

int DotNetDupe::System::FindLastCharIndex ( const std::string & s,
int iStartIndex,
char ch,
bool bIgnoreCase )
static

Definition at line 468 of file String.cpp.

References FindLastCharIndex().

Referenced by FindLastCharIndex(), and DotNetDupe::System::String::LastIndexOfAny().

◆ FormatClosingBrace()

void DotNetDupe::System::FormatClosingBrace ( const std::string & sFmt,
size_t & i,
std::string & sRes )
static

Handle escaped closing brace '}}' by appending a literal '}'.

Reject isolated, unescaped closing brace as malformed format syntax.

Definition at line 96 of file String.cpp.

References DotNetDupe::System::FormatException::FormatException(), and FormatClosingBrace().

Referenced by FormatClosingBrace(), and DotNetDupe::System::String::InternalFormat().

◆ FormatOpenBrace()

void DotNetDupe::System::FormatOpenBrace ( const std::string & sFmt,
size_t & i,
int & iAutoIndex,
const String * pArgs,
int iArgCount,
std::string & sRes )
static

Handle escaped open brace '{{' by appending a single literal '{'.

Handle auto-indexed placeholder '{}' by advancing sequential index.

Scan for closing delimiter and resolve explicit positional argument.

Definition at line 78 of file String.cpp.

References DotNetDupe::System::FormatException::FormatException(), AppendExplicitArg(), FormatOpenBrace(), and DotNetDupe::System::String::GetRawString().

Referenced by FormatOpenBrace(), and DotNetDupe::System::String::InternalFormat().

◆ FreeCollectionBuffer()

void DotNetDupe::System::FreeCollectionBuffer ( void * p)

Frees collection buffer allocated with AllocateCollectionBuffer.

Parameters
pPointer to memory block to release.

Release collection buffer memory back to heap via global operator delete.

Definition at line 44 of file Object.cpp.

References DOTNETDUPE_API, and FreeCollectionBuffer().

Referenced by FreeCollectionBuffer(), and DotNetDupe::System::Collections::Generic::LinkedListNode< T >::operator delete().

◆ GetCsidlForFolder()

int DotNetDupe::System::GetCsidlForFolder ( Environment::SpecialFolder eFolder)
static

◆ GetDatePart()

void DotNetDupe::System::GetDatePart ( int64_t ticks,
int & year,
int & month,
int & day )
static

Decomposes total ticks into Gregorian calendar date components (year, month, day).

Compute total days from ticks.

Calculate 400-year and century cycles.

Determine target year and lookup month days.

Determine month index and day of month.

Definition at line 62 of file DateTime.cpp.

References DaysToMonth365, DaysToMonth366, GetDatePart(), DotNetDupe::System::DateTime::IsLeapYear(), and TicksPerDay.

Referenced by DotNetDupe::System::DateTime::AddMonths(), GetDatePart(), DotNetDupe::System::DateTime::GetDay(), DotNetDupe::System::DateTime::GetDayOfYear(), DotNetDupe::System::DateTime::GetMonth(), DotNetDupe::System::DateTime::GetYear(), and DotNetDupe::System::DateTime::ToString().

◆ IsBase64()

bool DotNetDupe::System::IsBase64 ( unsigned char c)
static

Definition at line 302 of file Convert.cpp.

References IsBase64().

Referenced by DecodeBase64Loop(), and IsBase64().

◆ operator+() [1/2]

String DotNetDupe::System::operator+ ( char ch,
const String & sStr )

Definition at line 181 of file String.cpp.

◆ operator+() [2/2]

String DotNetDupe::System::operator+ ( const char * pStr,
const String & sStr )

Definition at line 176 of file String.cpp.

◆ ParseAndAddEnvEntry()

◆ ParseAuthorityComponents()

void DotNetDupe::System::ParseAuthorityComponents ( const String & authority,
const String & scheme,
String & userInfo,
String & host,
int & port )
static

Guard: If authority string is empty, return defaults.

Step: Extract optional user info preceding '@'.

Step: Extract host name and explicit or default port based on scheme.

Definition at line 70 of file Uri.cpp.

References DotNetDupe::System::String::String(), ParseAuthorityComponents(), and DotNetDupe::System::String::ToLower().

Referenced by ParseAuthorityComponents().

◆ ParseComponent()

bool DotNetDupe::System::ParseComponent ( const std::string & sPart,
int & iVal )
static

Guard: Check against empty component string.

Validate all characters in component are ASCII decimal digits.

Convert component to integer and enforce non-negative range.

Definition at line 12 of file Version.cpp.

References ParseComponent().

Referenced by ParseComponent(), and TryParseInternal().

◆ ParseDateTimeStr()

bool DotNetDupe::System::ParseDateTimeStr ( const String & s,
const String & format,
DateTime & result )
static

Parse date string according to format pattern.

Suppressed parse failure propagation for TryParse contract.

Suppressed std exception parse failure for TryParse contract.

Definition at line 367 of file DateTime.cpp.

References DotNetDupe::System::DateTime::DateTime(), ConvertFormat(), DotNetDupe::System::String::GetRawString(), and ParseDateTimeStr().

Referenced by ParseDateTimeStr(), DotNetDupe::System::DateTime::TryParse(), and DotNetDupe::System::DateTime::TryParseExact().

◆ ParsePath()

void DotNetDupe::System::ParsePath ( const std::string & rawUri,
const String & scheme,
String & path )
static

Step: Locate start of path after authority or scheme delimiter.

Step: Extract path substring before query or fragment indicators.

Definition at line 31 of file Uri.cpp.

References DotNetDupe::System::String::String(), DotNetDupe::System::String::Equals(), DotNetDupe::System::String::IsEmpty(), and ParsePath().

Referenced by ParsePath().

◆ ParseQueryAndFragment()

void DotNetDupe::System::ParseQueryAndFragment ( const std::string & rawUri,
String & query,
String & fragment )
static

Step: Extract query substring following question mark.

Step: Extract fragment substring following hash.

Definition at line 53 of file Uri.cpp.

References DotNetDupe::System::String::String(), and ParseQueryAndFragment().

Referenced by ParseQueryAndFragment().

◆ ParseSchemeAndAuthority()

void DotNetDupe::System::ParseSchemeAndAuthority ( const std::string & rawUri,
String & scheme,
String & authority )
static

Step: Find scheme delimiter and extract URI scheme.

Step: Extract authority component if double slash follows scheme.

Definition at line 14 of file Uri.cpp.

References DotNetDupe::System::String::String(), and ParseSchemeAndAuthority().

Referenced by ParseSchemeAndAuthority().

◆ PopulateSplitCharSet()

std::set< char > DotNetDupe::System::PopulateSplitCharSet ( const String * pSeparator,
int iCount )
static

◆ ReadCommandLineTokens()

std::vector< String > DotNetDupe::System::ReadCommandLineTokens ( )
static

◆ SplitByCharSet()

std::vector< String > DotNetDupe::System::SplitByCharSet ( const std::string & sText,
const std::set< char > & charSet,
StringSplitOptions eOptions )
static

Definition at line 583 of file String.cpp.

References AddSplitToken(), and SplitByCharSet().

Referenced by DotNetDupe::System::String::Split(), and SplitByCharSet().

◆ SplitVersionParts()

bool DotNetDupe::System::SplitVersionParts ( const String & sInput,
std::vector< std::string > & vecParts )
static

Guard: Validate input is not empty and has no leading or trailing dot.

Tokenize string by dot delimiter into individual component tokens.

Verify component count is strictly between 2 and 4.

Definition at line 32 of file Version.cpp.

References DotNetDupe::System::String::GetRawString(), DotNetDupe::System::String::IsEmpty(), and SplitVersionParts().

Referenced by SplitVersionParts(), and TryParseInternal().

◆ StaticCast()

template<typename To, typename From>
SmartPointer< To > DotNetDupe::System::StaticCast ( const SmartPointer< From > & sp)
inline

Definition at line 595 of file SmartPointer.h.

References StaticCast().

Referenced by StaticCast(), and StaticPointerCast().

◆ StaticPointerCast()

template<typename To, typename From>
SmartPointer< To > DotNetDupe::System::StaticPointerCast ( const SmartPointer< From > & sp)
inline

Definition at line 580 of file SmartPointer.h.

References StaticCast(), and StaticPointerCast().

Referenced by StaticPointerCast().

◆ ThrowArgumentException()

void DotNetDupe::System::ThrowArgumentException ( const char * msg)

◆ ThrowFormatException()

void DotNetDupe::System::ThrowFormatException ( const char * msg)

◆ TimeToTicks()

int64_t DotNetDupe::System::TimeToTicks ( int hour,
int minute,
int second )
static

Converts hour, minute, and second into total 100-nanosecond ticks.

Guard: Validate 24-hour time boundaries.

Calculate total seconds and scale to ticks.

Definition at line 50 of file DateTime.cpp.

References DotNetDupe::System::ArgumentOutOfRangeException::ArgumentOutOfRangeException(), TicksPerSecond, and TimeToTicks().

Referenced by DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), DotNetDupe::System::DateTime::DateTime(), TimeToTicks(), and TmToTicks().

◆ TmToTicks()

int64_t DotNetDupe::System::TmToTicks ( const struct tm & t,
int64_t remainderTicks )
static

Extract calendar components from tm structure.

Combine date, time, and sub-second remainder ticks.

Definition at line 264 of file DateTime.cpp.

References DateToTicks(), TimeToTicks(), and TmToTicks().

Referenced by TmToTicks(), DotNetDupe::System::DateTime::ToLocalTime(), and DotNetDupe::System::DateTime::ToUniversalTime().

◆ ToBaseString()

String DotNetDupe::System::ToBaseString ( unsigned long long llValue,
int iToBase )
static

◆ ToLowerString()

std::string DotNetDupe::System::ToLowerString ( const std::string & s)
static

Definition at line 260 of file String.cpp.

References ToLowerString().

Referenced by DotNetDupe::System::String::Compare(), and ToLowerString().

◆ TryParseInternal()

bool DotNetDupe::System::TryParseInternal ( const String & sInput,
int & iMajor,
int & iMinor,
int & iBuild,
int & iRevision,
int & iCount )
static

Split and validate dot-delimited tokens.

Parse each component integer and assign to respective positions.

Definition at line 50 of file Version.cpp.

References ParseComponent(), SplitVersionParts(), and TryParseInternal().

Referenced by DotNetDupe::System::Version::TryParse(), and TryParseInternal().

◆ UnescapePercentChar()

void DotNetDupe::System::UnescapePercentChar ( const std::string & s,
size_t & i,
std::string & unescaped )
static

Step: Decode two hex digits following percent symbol.

Definition at line 151 of file Uri.cpp.

References UnescapePercentChar().

Referenced by DotNetDupe::System::Uri::UnescapeDataString(), and UnescapePercentChar().

Variable Documentation

◆ base64_chars

const char DotNetDupe::System::base64_chars[]
static
Initial value:
=
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
"abcdefghijklmnopqrstuvwxyz"
"0123456789+/"

Definition at line 297 of file Convert.cpp.

Referenced by DecodeBase64Chunk4(), DecodeBase64Remainder(), EncodeBase64Chunk4(), and EncodeBase64Remainder().

◆ DaysToMonth365

int DotNetDupe::System::DaysToMonth365[] = { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334, 365 }
constexpr

◆ DaysToMonth366

int DotNetDupe::System::DaysToMonth366[] = { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335, 366 }
constexpr

◆ MaxTicks

int64_t DotNetDupe::System::MaxTicks = 3155378975999999999LL
constexpr

Definition at line 22 of file DateTime.cpp.

Referenced by DotNetDupe::System::DateTime::AddTicks().

◆ MinTicks

int64_t DotNetDupe::System::MinTicks = 0
constexpr

Definition at line 21 of file DateTime.cpp.

◆ TicksPerDay

◆ TicksPerHour

int64_t DotNetDupe::System::TicksPerHour = TicksPerMinute * 60
constexpr

Definition at line 19 of file DateTime.cpp.

Referenced by DotNetDupe::System::DateTime::GetHour().

◆ TicksPerMillisecond

◆ TicksPerMinute

int64_t DotNetDupe::System::TicksPerMinute = TicksPerSecond * 60
constexpr

Definition at line 18 of file DateTime.cpp.

Referenced by DotNetDupe::System::DateTime::GetMinute().

◆ TicksPerSecond

int64_t DotNetDupe::System::TicksPerSecond = TicksPerMillisecond * 1000
constexpr

◆ UnixEpochTicks

int64_t DotNetDupe::System::UnixEpochTicks = 621355968000000000LL
constexpr