Audacity 3.2.0
Functions | Variables
cloud::audiocom::anonymous_namespace{ServiceConfig.cpp} Namespace Reference

Functions

std::string Substitute (std::string pattern, std::initializer_list< std::pair< std::string_view, std::string_view > > substitutions)
 

Variables

StringSetting audioComApiEndpoint
 
StringSetting audioComOAuthClientID
 
StringSetting audioComOAuthClientSecret
 
StringSetting audioComOAuthRedirectURL
 
StringSetting audioComOAuthLoginPage
 
StringSetting audioComFinishUploadPage
 
StringSetting audioComAudioURL
 
StringSetting audioComAudioDownloadMimeType
 

Function Documentation

◆ Substitute()

std::string cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::Substitute ( std::string  pattern,
std::initializer_list< std::pair< std::string_view, std::string_view > >  substitutions 
)

Definition at line 69 of file ServiceConfig.cpp.

70{
71 for(auto& [key, value] : substitutions)
72 {
73 auto pos = pattern.find(key);
74
75 if (pos > 0 && pos != std::string::npos)
76 {
77 // There is no need to check that pos + key.size() is valid, there
78 // will be a zero terminator in the worst case.
79 if (pattern[pos - 1] == '{' && pattern[pos + key.size()] == '}')
80 pattern.replace(pos - 1, key.size() + 2, value);
81 }
82 }
83
84 return std::move(pattern);
85}
static const AudacityProject::AttachedObjects::RegisteredFactory key
constexpr size_t npos(-1)

References key, and Tuple::detail::npos().

Referenced by cloud::audiocom::ServiceConfig::GetAudioURL(), cloud::audiocom::ServiceConfig::GetFinishUploadPage(), and cloud::audiocom::ServiceConfig::GetOAuthLoginPage().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ audioComApiEndpoint

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComApiEndpoint
Initial value:
{
L"/CloudServices/AudioCom/ApiEndpoint",
L"https://api.audio.com"
}

Definition at line 29 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComAudioDownloadMimeType

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComAudioDownloadMimeType
Initial value:
{
L"/CloudServices/AudioCom/DownloadMimeType",
L"audio/x-wav"
}

Definition at line 64 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComAudioURL

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComAudioURL
Initial value:
{
L"/CloudServices/AudioCom/AudioURL",
L"https://audio.com/{user_slug}/audio/{audio_slug}/edit"
}

Definition at line 59 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComFinishUploadPage

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComFinishUploadPage
Initial value:
{
L"/CloudServices/AudioCom/FinishUploadPage",
L"https://audio.com/audacity/upload?audioId={audio_id}&token={auth_token}&clientId={auth_client_id}"
}

Definition at line 54 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComOAuthClientID

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthClientID
Initial value:
{
L"/CloudServices/AudioCom/OAuthClientID",
L"1741964426607541"
}

Definition at line 34 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComOAuthClientSecret

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthClientSecret
Initial value:
{
L"/CloudServices/AudioCom/OAuthClientSecret",
L"shKqnY2sLTfRK7hztwzNEVxnmhJfOy1i"
}

Definition at line 39 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComOAuthLoginPage

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthLoginPage
Initial value:
{
L"/CloudServices/AudioCom/OAuthLoginPage",
L"https://audio.com/audacity/link?clientId={auth_client_id}"
}

Definition at line 49 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().

◆ audioComOAuthRedirectURL

StringSetting cloud::audiocom::anonymous_namespace{ServiceConfig.cpp}::audioComOAuthRedirectURL
Initial value:
{
L"/CloudServices/AudioCom/OAuthRedirectURL",
L"https://audio.com/auth/sign-in/success"
}

Definition at line 44 of file ServiceConfig.cpp.

Referenced by cloud::audiocom::ServiceConfig::ServiceConfig().