Altium C++ SDK 3.0
Loading...
Searching...
No Matches
DXP.Util.h File Reference
#include <sstream>
#include <string>
#include <vector>
#include "DXP.Types.h"
#include "DXP.Interfaces.h"

Go to the source code of this file.

Classes

struct  TFileOwnershipDetails
class  WStringVector
class  CSensitiveCompare
class  CInsensitiveCompare

Macros

#define DXP_UTIL_H_INCLUDED

Functions

IClientGetClientInterface ()
bool ProcessKeyByClient (WORD keyID)
bool FileOwnership_IsOwnedByOther (const std::wstring &ADataFileName, std::wstring *AComputerName, std::wstring *AUserName)
bool FileOwnership_Details (const std::wstring &ADataFileName, TFileOwnershipDetails *ADetails)
void FileOwnership_WarnOwnedByOther (const std::wstring &AFullFileName, const std::wstring &AComputerName, const std::wstring &AUserName, TFileOwnershipWarningLevel AFileOwnershipWarningLevel)
void FileOwnership_WarnOwnedByOther_Message (const std::wstring &AFullFileName, const std::wstring &AComputerName, const std::wstring &AUserName)
void FileOwnership_WarnOwnedByOther_Dialog (const std::wstring &AFullFileName, const std::wstring &AComputerName, const std::wstring &AUserName)
void FileOwnership_ReportAcquisition_Message (const std::wstring &AFullFileName, const std::wstring &AComputerName, const std::wstring &AUserName)
bool OwnershipFileIsDangling (const std::wstring &ALockFileName)
void FileOwnership_CleanDanglingOwnershipFile (const std::wstring &ADataFileName)
HANDLE FileOwnership_RegisterAcquisition (const std::wstring &ADataFileName)
HANDLE FileOwnership_UnRegisterAcquisition (const std::wstring &ADataFileName, HANDLE ALockFileHandleInteger)
std::wstring GetOwnershipFileName (const std::wstring &ADataFileName)
std::wstring GetLocalComputerName ()
std::wstring GetLocalUserName ()
std::wstring GetCurrentProcessIdString ()
std::wstring GetCurrentProductName ()
std::wstring ExtractFilePath (const std::wstring &FileName)
std::wstring ExtractFileDir (const std::wstring &FileName)
std::wstring ExtractFileName (const std::wstring &FileName)
std::wstring ExtractFileExt (const std::wstring &FileName)
std::wstring ChangeFileExt (const std::wstring &FileName, const std::wstring &Extension)
std::wstring AddSlash (const std::wstring &Str, const WCHAR ASlash=L'\\')
void ShowWarning (const std::wstring &Text, const std::wstring &Caption=L"")
void ShowInfo (const std::wstring &Text, const std::wstring &Caption=L"")
void ShowError (const std::wstring &Text, const std::wstring &Caption=L"")
void ShowMessage (const std::wstring &Text)
bool ConfirmOKCancel (const std::wstring &Text)
bool ConfirmNoYes (const std::wstring &Text)
int ConfirmNoYesCancel (const std::wstring &Text)
bool ConfirmNoYesWithCaption (const std::wstring &Caption, const std::wstring &Text)
bool FileExists (const std::wstring &FileName)
HANDLE FileOpen (const std::wstring &FileName, unsigned int Mode)
void FileClose (HANDLE handle)
IOptionsReaderServerOptionsReader (const std::wstring &serverName)
IOptionsWriterServerOptionsWriter (const std::wstring &serverName)
wstring GetTime ()
double Now ()
double EncodeDate (WORD Year, WORD Month, WORD Day)
double EncodeTime (WORD Hour, WORD Min, WORD Sec, WORD MSec)
bool IsAltiumViewer ()
IClientAPI_InterfaceClientAPI ()
std::wstring SpecialFolder_MyDesigns ()
void RunCommand (const std::wstring &IdString, std::wstring SpecialParameter)
void RunCommand (const std::wstring &IdString, std::wstring SpecialParameter, IServerDocumentView *const DocumentView)
void MessageRouter_SendCommandToModule (const wstring &AProcess, wstring *AParameters, IServerDocumentView *const DocumentView)
std::wstring & LTrim (std::wstring &s)
std::wstring & RTrim (std::wstring &s)
std::wstring & Trim (std::wstring &s)
std::wstring & UpperCase (std::wstring &s)
std::wstring StringReplace (const std::wstring &S, const std::wstring &OldPattern, const std::wstring &NewPattern, bool ReplaceAll=true, bool IgnoreCase=false)
vector< wstring > & Split (const wstring &s, wchar_t delim, vector< wstring > &elems)
vector< wstring > Split (const wstring &s, wchar_t delim)
std::wstring ToWString (float val)
std::wstring ToWString (double val)
template<typename T>
std::wstring ToWString (T val)
std::wstring GetTemporaryFileName ()
std::wstring GetTemporaryFileName (const std::wstring &BaseFolder)
bool GetString_PrefixAndIndex (const std::wstring &Str, const std::wstring &Prefix, int *Index)
bool StringStartsWithButNotEqual (const std::wstring &AString, const std::wstring &SubString)
void StatusBar_SetState (int Index, const std::wstring &S)
std::wstring StatusBar_GetState (int Index)
void StatusBar_SetStateDefault ()
void StatusBar_PushStatus ()
void StatusBar_PopStatus ()
void Percent_Init (const std::wstring &InitialString, int TotalCount)
void Percent_Finish ()
void Percent_UpdateByNumber (int AmountToIncrement)
void Percent_Update ()
void Percent_BeginUndeterminedOperation (const std::wstring &InitialString)
void Percent_EndUndeterminedOperation ()
void Percent_BeginComplexOperation (const std::wstring &InitialString)
void Percent_EndComplexOperation ()
IServerDocumentCreateNewDocumentFromDocumentKind (const std::wstring &DocumentKind)
double round (double num)
double CoordToMils (int C)
double CoordToMMs (int C)
int MilsToCoord (double M)
double MilsToRealCoord (double M)
int MMsToCoord (double M)
double MMsToRealCoord (double M)
double DegreesToRadians (double Angle)
double RadiansToDegrees (double R)

Macro Definition Documentation

◆ DXP_UTIL_H_INCLUDED

#define DXP_UTIL_H_INCLUDED

Function Documentation

◆ AddSlash()

std::wstring AddSlash ( const std::wstring & Str,
const WCHAR ASlash = L'\\' )

◆ ChangeFileExt()

std::wstring ChangeFileExt ( const std::wstring & FileName,
const std::wstring & Extension )

◆ ClientAPI()

IClientAPI_Interface * ClientAPI ( )

◆ ConfirmNoYes()

bool ConfirmNoYes ( const std::wstring & Text)

◆ ConfirmNoYesCancel()

int ConfirmNoYesCancel ( const std::wstring & Text)

◆ ConfirmNoYesWithCaption()

bool ConfirmNoYesWithCaption ( const std::wstring & Caption,
const std::wstring & Text )

◆ ConfirmOKCancel()

bool ConfirmOKCancel ( const std::wstring & Text)

◆ CoordToMils()

double CoordToMils ( int C)

◆ CoordToMMs()

double CoordToMMs ( int C)

◆ CreateNewDocumentFromDocumentKind()

IServerDocument * CreateNewDocumentFromDocumentKind ( const std::wstring & DocumentKind)

◆ DegreesToRadians()

double DegreesToRadians ( double Angle)

◆ EncodeDate()

double EncodeDate ( WORD Year,
WORD Month,
WORD Day )

◆ EncodeTime()

double EncodeTime ( WORD Hour,
WORD Min,
WORD Sec,
WORD MSec )

◆ ExtractFileDir()

std::wstring ExtractFileDir ( const std::wstring & FileName)

◆ ExtractFileExt()

std::wstring ExtractFileExt ( const std::wstring & FileName)

◆ ExtractFileName()

std::wstring ExtractFileName ( const std::wstring & FileName)

◆ ExtractFilePath()

std::wstring ExtractFilePath ( const std::wstring & FileName)

◆ FileClose()

void FileClose ( HANDLE handle)

◆ FileExists()

bool FileExists ( const std::wstring & FileName)

◆ FileOpen()

HANDLE FileOpen ( const std::wstring & FileName,
unsigned int Mode )

◆ FileOwnership_CleanDanglingOwnershipFile()

void FileOwnership_CleanDanglingOwnershipFile ( const std::wstring & ADataFileName)

◆ FileOwnership_Details()

bool FileOwnership_Details ( const std::wstring & ADataFileName,
TFileOwnershipDetails * ADetails )

◆ FileOwnership_IsOwnedByOther()

bool FileOwnership_IsOwnedByOther ( const std::wstring & ADataFileName,
std::wstring * AComputerName,
std::wstring * AUserName )

◆ FileOwnership_RegisterAcquisition()

HANDLE FileOwnership_RegisterAcquisition ( const std::wstring & ADataFileName)

◆ FileOwnership_ReportAcquisition_Message()

void FileOwnership_ReportAcquisition_Message ( const std::wstring & AFullFileName,
const std::wstring & AComputerName,
const std::wstring & AUserName )

◆ FileOwnership_UnRegisterAcquisition()

HANDLE FileOwnership_UnRegisterAcquisition ( const std::wstring & ADataFileName,
HANDLE ALockFileHandleInteger )

◆ FileOwnership_WarnOwnedByOther()

void FileOwnership_WarnOwnedByOther ( const std::wstring & AFullFileName,
const std::wstring & AComputerName,
const std::wstring & AUserName,
TFileOwnershipWarningLevel AFileOwnershipWarningLevel )

◆ FileOwnership_WarnOwnedByOther_Dialog()

void FileOwnership_WarnOwnedByOther_Dialog ( const std::wstring & AFullFileName,
const std::wstring & AComputerName,
const std::wstring & AUserName )

◆ FileOwnership_WarnOwnedByOther_Message()

void FileOwnership_WarnOwnedByOther_Message ( const std::wstring & AFullFileName,
const std::wstring & AComputerName,
const std::wstring & AUserName )

◆ GetClientInterface()

IClient * GetClientInterface ( )

◆ GetCurrentProcessIdString()

std::wstring GetCurrentProcessIdString ( )

◆ GetCurrentProductName()

std::wstring GetCurrentProductName ( )

◆ GetLocalComputerName()

std::wstring GetLocalComputerName ( )

◆ GetLocalUserName()

std::wstring GetLocalUserName ( )

◆ GetOwnershipFileName()

std::wstring GetOwnershipFileName ( const std::wstring & ADataFileName)

◆ GetString_PrefixAndIndex()

bool GetString_PrefixAndIndex ( const std::wstring & Str,
const std::wstring & Prefix,
int * Index )

◆ GetTemporaryFileName() [1/2]

std::wstring GetTemporaryFileName ( )

◆ GetTemporaryFileName() [2/2]

std::wstring GetTemporaryFileName ( const std::wstring & BaseFolder)

◆ GetTime()

wstring GetTime ( )

◆ IsAltiumViewer()

bool IsAltiumViewer ( )

◆ LTrim()

std::wstring & LTrim ( std::wstring & s)

◆ MessageRouter_SendCommandToModule()

void MessageRouter_SendCommandToModule ( const wstring & AProcess,
wstring * AParameters,
IServerDocumentView *const DocumentView )

◆ MilsToCoord()

int MilsToCoord ( double M)

◆ MilsToRealCoord()

double MilsToRealCoord ( double M)

◆ MMsToCoord()

int MMsToCoord ( double M)

◆ MMsToRealCoord()

double MMsToRealCoord ( double M)

◆ Now()

double Now ( )

◆ OwnershipFileIsDangling()

bool OwnershipFileIsDangling ( const std::wstring & ALockFileName)

◆ Percent_BeginComplexOperation()

void Percent_BeginComplexOperation ( const std::wstring & InitialString)

◆ Percent_BeginUndeterminedOperation()

void Percent_BeginUndeterminedOperation ( const std::wstring & InitialString)

◆ Percent_EndComplexOperation()

void Percent_EndComplexOperation ( )

◆ Percent_EndUndeterminedOperation()

void Percent_EndUndeterminedOperation ( )

◆ Percent_Finish()

void Percent_Finish ( )

◆ Percent_Init()

void Percent_Init ( const std::wstring & InitialString,
int TotalCount )

◆ Percent_Update()

void Percent_Update ( )

◆ Percent_UpdateByNumber()

void Percent_UpdateByNumber ( int AmountToIncrement)

◆ ProcessKeyByClient()

bool ProcessKeyByClient ( WORD keyID)

◆ RadiansToDegrees()

double RadiansToDegrees ( double R)

◆ round()

double round ( double num)

◆ RTrim()

std::wstring & RTrim ( std::wstring & s)

◆ RunCommand() [1/2]

void RunCommand ( const std::wstring & IdString,
std::wstring SpecialParameter )

◆ RunCommand() [2/2]

void RunCommand ( const std::wstring & IdString,
std::wstring SpecialParameter,
IServerDocumentView *const DocumentView )

◆ ServerOptionsReader()

IOptionsReader * ServerOptionsReader ( const std::wstring & serverName)

◆ ServerOptionsWriter()

IOptionsWriter * ServerOptionsWriter ( const std::wstring & serverName)

◆ ShowError()

void ShowError ( const std::wstring & Text,
const std::wstring & Caption = L"" )

◆ ShowInfo()

void ShowInfo ( const std::wstring & Text,
const std::wstring & Caption = L"" )

◆ ShowMessage()

void ShowMessage ( const std::wstring & Text)

◆ ShowWarning()

void ShowWarning ( const std::wstring & Text,
const std::wstring & Caption = L"" )

◆ SpecialFolder_MyDesigns()

std::wstring SpecialFolder_MyDesigns ( )

◆ Split() [1/2]

vector< wstring > Split ( const wstring & s,
wchar_t delim )

◆ Split() [2/2]

vector< wstring > & Split ( const wstring & s,
wchar_t delim,
vector< wstring > & elems )

◆ StatusBar_GetState()

std::wstring StatusBar_GetState ( int Index)

◆ StatusBar_PopStatus()

void StatusBar_PopStatus ( )

◆ StatusBar_PushStatus()

void StatusBar_PushStatus ( )

◆ StatusBar_SetState()

void StatusBar_SetState ( int Index,
const std::wstring & S )

◆ StatusBar_SetStateDefault()

void StatusBar_SetStateDefault ( )

◆ StringReplace()

std::wstring StringReplace ( const std::wstring & S,
const std::wstring & OldPattern,
const std::wstring & NewPattern,
bool ReplaceAll = true,
bool IgnoreCase = false )

◆ StringStartsWithButNotEqual()

bool StringStartsWithButNotEqual ( const std::wstring & AString,
const std::wstring & SubString )

◆ ToWString() [1/3]

std::wstring ToWString ( double val)

◆ ToWString() [2/3]

std::wstring ToWString ( float val)

◆ ToWString() [3/3]

template<typename T>
std::wstring ToWString ( T val)

◆ Trim()

std::wstring & Trim ( std::wstring & s)

◆ UpperCase()

std::wstring & UpperCase ( std::wstring & s)