From cbfdf99a9efab15a79cdc7ed790291921afcf706 Mon Sep 17 00:00:00 2001 From: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> Date: Tue, 3 Aug 2021 17:59:09 -0700 Subject: [PATCH] More github cleanup Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com> --- .../GridMate/GridMate/Carrier/Carrier.cpp | 14 ++++---- .../GridMate/GridMate/Carrier/Carrier.h | 7 ++-- .../GridMate/Carrier/DefaultTrafficControl.h | 2 +- .../GridMate/GridMate/Carrier/Driver.h | 11 +++--- .../GridMate/GridMate/Carrier/Handshake.h | 1 - .../GridMate/Carrier/SecureSocketDriver.cpp | 6 ++-- .../GridMate/Carrier/SecureSocketDriver.h | 6 ++-- .../GridMate/Carrier/SocketDriver.cpp | 27 +++++++------- .../GridMate/GridMate/Carrier/SocketDriver.h | 12 +++---- .../GridMate/Carrier/TrafficControl.h | 1 - .../GridMate/GridMate/Carrier/Utils.h | 4 +-- .../GridMate/Drillers/CarrierDriller.cpp | 2 +- .../GridMate/Drillers/CarrierDriller.h | 2 +- .../GridMate/Drillers/ReplicaDriller.cpp | 1 - .../GridMate/Online/UserServiceTypes.h | 1 - .../GridMate/GridMate/Replica/ReplicaStatus.h | 3 +- .../GridMate/GridMate/Session/LANSession.cpp | 28 +++++++-------- .../GridMate/Session/LANSessionServiceTypes.h | 2 +- .../GridMate/GridMate/Session/Session.cpp | 36 +++++++++---------- .../GridMate/GridMate/Session/Session.h | 20 +++++------ .../GridMate/GridMate/String/StringUtils.h | 10 ------ .../GridMate/GridMate/String/string.h | 26 -------------- .../GridMate/VoiceChat/VoiceChatServiceBus.h | 1 - .../GridMate/GridMate/gridmate_files.cmake | 1 - .../GridMate/Session/LANSession_Android.cpp | 5 ++- .../GridMate/Carrier/Utils_UnixLike.cpp | 4 +-- .../WinAPI/GridMate/Carrier/Utils_WinAPI.cpp | 4 +-- .../GridMate/Session/LANSession_Linux.cpp | 5 ++- .../GridMate/String/StringUtils_Platform.h | 8 ----- .../Mac/GridMate/Session/LANSession_Mac.cpp | 5 ++- .../GridMate/Session/LANSession_Windows.cpp | 6 ++-- .../iOS/GridMate/Session/LANSession_iOS.cpp | 5 ++- Code/Framework/GridMate/Tests/Carrier.cpp | 8 ++--- .../Tests/CarrierStreamSocketDriverTests.cpp | 6 ++-- Code/Framework/GridMate/Tests/Replica.cpp | 4 +-- Code/Framework/GridMate/Tests/Serialize.cpp | 4 +-- .../Framework/GridMate/Tests/TestProfiler.cpp | 20 +++++------ 37 files changed, 125 insertions(+), 183 deletions(-) delete mode 100644 Code/Framework/GridMate/GridMate/String/StringUtils.h delete mode 100644 Code/Framework/GridMate/GridMate/String/string.h delete mode 100644 Code/Framework/GridMate/Platform/Linux/GridMate/String/StringUtils_Platform.h diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp index 23e967c3fa..0285a7fc02 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.cpp @@ -422,7 +422,7 @@ namespace GridMate CarrierThread* m_threadOwner; ///< Pointer to the carrier thread that operates with this connection. AZStd::atomic m_threadConn; ///< Pointer to a thread connection. You can use it in the main thread only for a reference. - string m_fullAddress; ///< Connection full address. + AZStd::string m_fullAddress; ///< Connection full address. Carrier::ConnectionStates m_state; @@ -604,7 +604,7 @@ namespace GridMate Connection* m_connection; ThreadConnection* m_threadConnection; - string m_newConnectionAddress; + AZStd::string m_newConnectionAddress; CarrierErrorCode m_errorCode; AZ::u32 m_newRateBytesPerSec; ///< new send rate AZStd::vector > m_ackCallbacks; @@ -1007,7 +1007,7 @@ namespace GridMate unsigned int GetMessageMTU() override { return m_maxMsgDataSizeBytes; } - string ConnectionToAddress(ConnectionID id) override; + AZStd::string ConnectionToAddress(ConnectionID id) override; void SendWithCallback(const char* data, unsigned int dataSize, AZStd::unique_ptr ackCallback, ConnectionID target = AllConnections, DataReliability reliability = SEND_RELIABLE, DataPriority priority = PRIORITY_NORMAL, unsigned char channel = 0) override; void Send(const char* data, unsigned int dataSize, ConnectionID target = AllConnections, DataReliability reliability = SEND_RELIABLE, DataPriority priority = PRIORITY_NORMAL, unsigned char channel = 0) override @@ -3902,10 +3902,10 @@ CarrierImpl::DeleteConnection(Connection* conn, CarrierDisconnectReason reason) // Carrier // [9/14/2010] //========================================================================= -string +AZStd::string CarrierImpl::ConnectionToAddress(ConnectionID id) { - string str; + AZStd::string str; AZ_Assert(id != InvalidConnectionID, "Invalid connection id!"); if (id != InvalidConnectionID) { @@ -4911,7 +4911,7 @@ DefaultCarrier::Create(const CarrierDesc& desc, IGridMate* gridMate) // ReasonToString // [4/11/2011] //========================================================================= -string +AZStd::string CarrierEventsBase::ReasonToString(CarrierDisconnectReason reason) { const char* reasonStr = 0; @@ -4951,5 +4951,5 @@ CarrierEventsBase::ReasonToString(CarrierDisconnectReason reason) reasonStr = "Unknown reason"; } - return string(reasonStr); + return AZStd::string(reasonStr); } diff --git a/Code/Framework/GridMate/GridMate/Carrier/Carrier.h b/Code/Framework/GridMate/GridMate/Carrier/Carrier.h index 2968582c0d..94c31ed6d2 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Carrier.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Carrier.h @@ -9,7 +9,6 @@ #define GM_CARRIER_H #include -#include #include #include #include @@ -100,7 +99,7 @@ namespace GridMate /// Returns maximum message size (with splitting or without). Splitting will make your message reliable, which might not be optimal for Unreliable messages. It's better to send two unreliable. //virtual unsigned int GetMaxMessageSize(bool withSplitting = true) = 0; - virtual string ConnectionToAddress(ConnectionID id) = 0; + virtual AZStd::string ConnectionToAddress(ConnectionID id) = 0; /** * Sends buffer with an ACK callback. When the transport layer recieves an ACK it will run the callback. @@ -401,7 +400,7 @@ namespace GridMate public: virtual ~CarrierEventsBase() {} - string ReasonToString(CarrierDisconnectReason reason); + AZStd::string ReasonToString(CarrierDisconnectReason reason); }; class CarrierEvents @@ -517,7 +516,7 @@ namespace GridMate // Traffic control /// Called every second when you update last second statistics - virtual void OnUpdateStatistics(const GridMate::string& address, const TrafficControl::Statistics& lastSecond, const TrafficControl::Statistics& lifeTime, const TrafficControl::Statistics& effectiveLastSecond, const TrafficControl::Statistics& effectiveLifeTime) = 0; + virtual void OnUpdateStatistics(const AZStd::string& address, const TrafficControl::Statistics& lastSecond, const TrafficControl::Statistics& lifeTime, const TrafficControl::Statistics& effectiveLastSecond, const TrafficControl::Statistics& effectiveLifeTime) = 0; // Simulator /// Enable/Disable diff --git a/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.h b/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.h index 525009b015..1d8a1f6b46 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.h +++ b/Code/Framework/GridMate/GridMate/Carrier/DefaultTrafficControl.h @@ -145,7 +145,7 @@ namespace GridMate StatisticData m_sdEffectiveLastSecond; ///< Last second statistics for effective data. StatisticData m_sdEffectiveCurrentSecond; ///< Elapsing second statistics for effective data. - string m_address; ///< Full address for this connection. (we need for debug only) + AZStd::string m_address; ///< Full address for this connection. (we need for debug only) unsigned int m_recvPacketAllowance; ///< Current allowance for number of incoming packets bool m_canReceiveData; ///< Able to receive data on this connection diff --git a/Code/Framework/GridMate/GridMate/Carrier/Driver.h b/Code/Framework/GridMate/GridMate/Carrier/Driver.h index 2c806be5e0..d6d47fc491 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Driver.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Driver.h @@ -10,10 +10,9 @@ #include -#include - #include #include +#include namespace GridMate { @@ -139,7 +138,7 @@ namespace GridMate /// @{ Address conversion functionality. They MUST implemented thread safe. Generally this is not a problem since they just part local data. /// Create address from ip and port. If ip == NULL we will assign a broadcast address. - virtual string IPPortToAddress(const char* ip, unsigned int port) const = 0; + virtual AZStd::string IPPortToAddress(const char* ip, unsigned int port) const = 0; virtual bool AddressToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) const = 0; /// @} @@ -188,11 +187,11 @@ namespace GridMate virtual ~DriverAddress() {} - virtual string ToString() const = 0; + virtual AZStd::string ToString() const = 0; - virtual string ToAddress() const = 0; + virtual AZStd::string ToAddress() const = 0; - virtual string GetIP() const = 0; + virtual AZStd::string GetIP() const = 0; virtual unsigned int GetPort() const = 0; diff --git a/Code/Framework/GridMate/GridMate/Carrier/Handshake.h b/Code/Framework/GridMate/GridMate/Carrier/Handshake.h index ffd332b65c..0f825da49b 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Handshake.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Handshake.h @@ -10,7 +10,6 @@ #include #include -#include namespace GridMate { diff --git a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp index 7d0d5644b3..031e8561ec 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.cpp @@ -1712,7 +1712,7 @@ namespace GridMate } // Calculate HMAC of buffer using the secret and peer address - GridMate::string addrStr = endpoint->ToAddress(); + AZStd::string addrStr = endpoint->ToAddress(); unsigned char result[EVP_MAX_MD_SIZE]; unsigned int resultLen = 0; HMAC(EVP_sha1(), m_cookieSecret.m_currentSecret, sizeof(m_cookieSecret.m_currentSecret), @@ -1745,7 +1745,7 @@ namespace GridMate } // Calculate HMAC of buffer using the secret and peer address - GridMate::string addrStr = endpoint->ToAddress(); + AZStd::string addrStr = endpoint->ToAddress(); unsigned char result[EVP_MAX_MD_SIZE]; unsigned int resultLen = 0; HMAC(EVP_sha1(), m_cookieSecret.m_currentSecret, COOKIE_SECRET_LENGTH, @@ -1809,7 +1809,7 @@ namespace GridMate #ifdef AZ_DebugUseSocketDebugLog if (handshake) { - GridMate::string line = GridMate::string::format("%lld | [%08x] RawRecv %s size %d connection exists\n", AZStd::chrono::system_clock::now().time_since_epoch().count(), this, type, bytesReceived); + AZStd::string line = AZStd::string::format("%lld | [%08x] RawRecv %s size %d connection exists\n", AZStd::chrono::system_clock::now().time_since_epoch().count(), this, type, bytesReceived); connection->m_dbgLog += line; } #endif diff --git a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h index 529ccea408..76b7958085 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h +++ b/Code/Framework/GridMate/GridMate/Carrier/SecureSocketDriver.h @@ -23,7 +23,7 @@ //#define AZ_DebugSecureSocket AZ_TracePrintf //#define AZ_DebugSecureSocketConnection(window, fmt, ...) \ //{\ -// GridMate::string line = GridMate::string::format(fmt, __VA_ARGS__);\ +// AZStd::string line = AZStd::string::format(fmt, __VA_ARGS__);\ // this->m_dbgLog += line;\ //} @@ -226,7 +226,7 @@ namespace GridMate int m_dbgDgramsReceived; int m_dbgPort; #ifdef AZ_DebugUseSocketDebugLog - GridMate::string m_dbgLog; + AZStd::string m_dbgLog; #endif }; @@ -262,7 +262,7 @@ namespace GridMate AZ::u32 m_maxTempBufferSize; AZStd::queue m_globalInQueue; AZStd::unordered_map m_connections; - AZStd::unordered_map m_ipToNumConnections; + AZStd::unordered_map m_ipToNumConnections; SecureSocketDesc m_desc; AZStd::chrono::system_clock::time_point m_lastTimerCheck; ///Time last timers were checked }; diff --git a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp index fc3062062c..6acf778798 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp +++ b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.cpp @@ -18,7 +18,6 @@ //#define AZ_LOG_UNBOUND_SEND_RECEIVE #include -#include #include #include @@ -575,7 +574,7 @@ namespace GridMate return !(*this == rhs); } - string SocketDriverAddress::ToString() const + AZStd::string SocketDriverAddress::ToString() const { char ip[64]; unsigned short port; @@ -590,15 +589,15 @@ namespace GridMate port = ntohs(m_sockAddr.sin_port); } - return string::format("%s|%d", ip, port); + return AZStd::string::format("%s|%d", ip, port); } - string SocketDriverAddress::ToAddress() const + AZStd::string SocketDriverAddress::ToAddress() const { return ToString(); } - string SocketDriverAddress::GetIP() const + AZStd::string SocketDriverAddress::GetIP() const { char ip[64]; if (m_sockAddr.sin_family == AF_INET6) @@ -609,7 +608,7 @@ namespace GridMate { inet_ntop(AF_INET, const_cast(reinterpret_cast(&m_sockAddr.sin_addr)), ip, AZ_ARRAY_SIZE(ip)); } - return string(ip); + return AZStd::string(ip); } unsigned int SocketDriverAddress::GetPort() const @@ -1144,11 +1143,11 @@ namespace GridMate // CreateSocketDriver // [3/4/2013] //========================================================================= - string + AZStd::string SocketDriverCommon::IPPortToAddressString(const char* ip, unsigned int port) { AZ_Assert(ip != nullptr, "Invalid address!"); - return string::format("%s|%d", ip, port); + return AZStd::string::format("%s|%d", ip, port); } //========================================================================= @@ -1159,14 +1158,14 @@ namespace GridMate SocketDriverCommon::AddressStringToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) { AZStd::size_t pos = address.find('|'); - AZ_Assert(pos != string::npos, "Invalid driver address!"); - if (pos == string::npos) + AZ_Assert(pos != AZStd::string::npos, "Invalid driver address!"); + if (pos == AZStd::string::npos) { return false; } - ip = string(address.begin(), address.begin() + pos); - port = AZStd::stoi(string(address.begin() + pos + 1, address.end())); + ip = AZStd::string(address.begin(), address.begin() + pos); + port = AZStd::stoi(AZStd::string(address.begin() + pos + 1, address.end())); return true; } @@ -1180,12 +1179,12 @@ namespace GridMate { // TODO: We can/should use inet_ntop() to detect the family type AZStd::size_t pos = ip.find("."); - if (pos != string::npos) + if (pos != AZStd::string::npos) { return BSD_AF_INET; } pos = ip.find("::"); - if (pos != string::npos) + if (pos != AZStd::string::npos) { return BSD_AF_INET6; } diff --git a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h index 7555c92639..835414b374 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h +++ b/Code/Framework/GridMate/GridMate/Carrier/SocketDriver.h @@ -88,9 +88,9 @@ namespace GridMate bool operator==(const SocketDriverAddress& rhs) const; bool operator!=(const SocketDriverAddress& rhs) const; - virtual string ToString() const; - virtual string ToAddress() const; - virtual string GetIP() const; + virtual AZStd::string ToString() const; + virtual AZStd::string ToAddress() const; + virtual AZStd::string GetIP() const; virtual unsigned int GetPort() const; virtual const void* GetTargetAddress(unsigned int& addressSize) const; @@ -163,15 +163,15 @@ namespace GridMate /// @{ Address conversion functionality. They MUST implemented thread safe. Generally this is not a problem since they just part local data. /// Create address from ip and port. If ip == NULL we will assign a broadcast address. - virtual string IPPortToAddress(const char* ip, unsigned int port) const { return IPPortToAddressString(ip, port); } + virtual AZStd::string IPPortToAddress(const char* ip, unsigned int port) const { return IPPortToAddressString(ip, port); } virtual bool AddressToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port) const { return AddressStringToIPPort(address, ip, port); } /// Create address for the socket driver from IP and port - static string IPPortToAddressString(const char* ip, unsigned int port); + static AZStd::string IPPortToAddressString(const char* ip, unsigned int port); /// Decompose an address to IP and port static bool AddressStringToIPPort(const AZStd::string& address, AZStd::string& ip, unsigned int& port); /// Return the family type of the address (AF_INET,AF_INET6 AF_UNSPEC) static BSDSocketFamilyType AddressFamilyType(const AZStd::string& ip); - static BSDSocketFamilyType AddressFamilyType(const char* ip) { return AddressFamilyType(string(ip)); } + static BSDSocketFamilyType AddressFamilyType(const char* ip) { return AddressFamilyType(AZStd::string(ip)); } /// @} virtual AZStd::intrusive_ptr CreateDriverAddress(const AZStd::string& address) = 0; diff --git a/Code/Framework/GridMate/GridMate/Carrier/TrafficControl.h b/Code/Framework/GridMate/GridMate/Carrier/TrafficControl.h index 2b49f320b5..7b79124a73 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/TrafficControl.h +++ b/Code/Framework/GridMate/GridMate/Carrier/TrafficControl.h @@ -9,7 +9,6 @@ #define GM_TRAFFIC_CONTROL_H #include -#include #include diff --git a/Code/Framework/GridMate/GridMate/Carrier/Utils.h b/Code/Framework/GridMate/GridMate/Carrier/Utils.h index 2b15696ac2..db58ec979e 100644 --- a/Code/Framework/GridMate/GridMate/Carrier/Utils.h +++ b/Code/Framework/GridMate/GridMate/Carrier/Utils.h @@ -8,14 +8,14 @@ #ifndef GM_CARRIER_UTILS_H #define GM_CARRIER_UTILS_H -#include +#include namespace GridMate { namespace Utils { ///< Returns the machines address(ip) in a string. familyType is platform dependent. - string GetMachineAddress(int familyType = 0); + AZStd::string GetMachineAddress(int familyType = 0); ///< Returns a broadcast address based on a family type. On ipv6 we emulate broadbast using the multicast on the all nodes address (FF02::1). familyType is platform dependent. const char* GetBroadcastAddress(int familyType = 0); } diff --git a/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.cpp b/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.cpp index 528afa6cce..38f029f0f5 100644 --- a/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.cpp +++ b/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.cpp @@ -64,7 +64,7 @@ namespace GridMate // OnUpdateStatistics // [4/14/2011] //========================================================================= - void CarrierDriller::OnUpdateStatistics(const GridMate::string& address, const TrafficControl::Statistics& lastSecond, const TrafficControl::Statistics& lifeTime, const TrafficControl::Statistics& effectiveLastSecond, const TrafficControl::Statistics& effectiveLifeTime) + void CarrierDriller::OnUpdateStatistics(const AZStd::string& address, const TrafficControl::Statistics& lastSecond, const TrafficControl::Statistics& lifeTime, const TrafficControl::Statistics& effectiveLastSecond, const TrafficControl::Statistics& effectiveLifeTime) { m_output->BeginTag(m_drillerTag); m_output->BeginTag(AZ_CRC("Statistics", 0xe2d38b22)); diff --git a/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.h b/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.h index bb3cb1e3b2..b12441e6fa 100644 --- a/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.h +++ b/Code/Framework/GridMate/GridMate/Drillers/CarrierDriller.h @@ -42,7 +42,7 @@ namespace GridMate ////////////////////////////////////////////////////////////////////////// // Carrier Driller Bus - void OnUpdateStatistics(const GridMate::string& address, const TrafficControl::Statistics& lastSecond, const TrafficControl::Statistics& lifeTime, const TrafficControl::Statistics& effectiveLastSecond, const TrafficControl::Statistics& effectiveLifeTime) override; + void OnUpdateStatistics(const AZStd::string& address, const TrafficControl::Statistics& lastSecond, const TrafficControl::Statistics& lifeTime, const TrafficControl::Statistics& effectiveLastSecond, const TrafficControl::Statistics& effectiveLifeTime) override; void OnConnectionStateChanged(Carrier* carrier, ConnectionID id, Carrier::ConnectionStates newState) override; ////////////////////////////////////////////////////////////////////////// diff --git a/Code/Framework/GridMate/GridMate/Drillers/ReplicaDriller.cpp b/Code/Framework/GridMate/GridMate/Drillers/ReplicaDriller.cpp index e70aceabc9..cb48578255 100644 --- a/Code/Framework/GridMate/GridMate/Drillers/ReplicaDriller.cpp +++ b/Code/Framework/GridMate/GridMate/Drillers/ReplicaDriller.cpp @@ -9,7 +9,6 @@ #include #include #include -#include using namespace AZ::Debug; diff --git a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h b/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h index 2617d98d73..c1753b3bb2 100644 --- a/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h +++ b/Code/Framework/GridMate/GridMate/Online/UserServiceTypes.h @@ -9,7 +9,6 @@ #define GM_USER_SERVICE_TYPES_H #include -#include namespace GridMate { diff --git a/Code/Framework/GridMate/GridMate/Replica/ReplicaStatus.h b/Code/Framework/GridMate/GridMate/Replica/ReplicaStatus.h index 019a595f6f..aeb5c1b2bb 100644 --- a/Code/Framework/GridMate/GridMate/Replica/ReplicaStatus.h +++ b/Code/Framework/GridMate/GridMate/Replica/ReplicaStatus.h @@ -12,7 +12,6 @@ #include #include #include -#include #include namespace GridMate @@ -102,7 +101,7 @@ namespace GridMate }; AZ::u8 m_flags; - string m_replicaName; + AZStd::string m_replicaName; }; DataSet m_options; // Flags and debug info diff --git a/Code/Framework/GridMate/GridMate/Session/LANSession.cpp b/Code/Framework/GridMate/GridMate/Session/LANSession.cpp index 0127d8fa23..e4e1c9e9b6 100644 --- a/Code/Framework/GridMate/GridMate/Session/LANSession.cpp +++ b/Code/Framework/GridMate/GridMate/Session/LANSession.cpp @@ -52,17 +52,17 @@ namespace GridMate MemberIDCompact GetID() const { return m_id; } - virtual string ToString() const + virtual AZStd::string ToString() const { - return string::format("%x", m_id); + return AZStd::string::format("%x", m_id); } - virtual string ToAddress() const { return m_address; } + virtual AZStd::string ToAddress() const { return m_address; } virtual MemberIDCompact Compact() const { return m_id; } virtual bool IsValid() const { return m_id != 0; } private: MemberIDCompact m_id; - string m_address; + AZStd::string m_address; }; class LANMemberIDMarshaler @@ -141,7 +141,7 @@ namespace GridMate bool MatchMake(const LANSearchParams& sp); - string MakeSessionId(); + AZStd::string MakeSessionId(); Driver* m_driver; ///< Driver for network searches @@ -199,7 +199,7 @@ namespace GridMate : public CtorContextBase { CtorDataSet m_memberId; - CtorDataSet m_memberAddress; ///< As the server/host sees it! + CtorDataSet m_memberAddress; ///< As the server/host sees it! CtorDataSet m_peerMode; CtorDataSet m_isHost; }; @@ -232,7 +232,7 @@ namespace GridMate AZ_Assert(session, "We need to have a valid session!"); LANMember* member; MemberIDCompact memberId = ctorContext.m_memberId.Get(); - string memberAddress = ctorContext.m_memberAddress.Get(); + AZStd::string memberAddress = ctorContext.m_memberAddress.Get(); RemotePeerMode remotePeerMode = ctorContext.m_peerMode.Get(); bool isMemberHost = ctorContext.m_isHost.Get(); @@ -349,7 +349,7 @@ namespace GridMate { namespace Platform { - void AssignExtendedName(GridMate::string& extendedName); + void AssignExtendedName(AZStd::string& extendedName); } } @@ -364,7 +364,7 @@ LANMember::LANMember(const LANMemberID& id, LANSession* session) : GridMember(id.Compact()) , m_memberId(id) { - string extendedName; + AZStd::string extendedName; Platform::AssignExtendedName(extendedName); m_session = session; @@ -741,8 +741,8 @@ LANSession::CreateLocalMember(bool isHost, bool isInvited, RemotePeerMode peerMo { AZ_Assert(m_myMember == nullptr, "We already have added a local member!"); - string ip = Utils::GetMachineAddress(m_carrierDesc.m_familyType); - string address = SocketDriverCommon::IPPortToAddressString(ip.c_str(), m_carrierDesc.m_port); + AZStd::string ip = Utils::GetMachineAddress(m_carrierDesc.m_familyType); + AZStd::string address = SocketDriverCommon::IPPortToAddressString(ip.c_str(), m_carrierDesc.m_port); ///////////////////////////////////////////////////////////////////////////// // TODO: Use the UUID as an ID, we will need to add marshalers and so on AZ::Uuid uuid = AZ::Uuid::CreateRandom(); @@ -881,7 +881,7 @@ LANSession::OnStateHostMigrateSession(AZ::HSM& sm, const AZ::HSM::Event& e) if (m_driver->Initialize(Driver::BSD_AF_INET, nullptr, hostPort, true) != Driver::EC_OK) { // check the output for more info - string errorMsg = string::format("Failed to initialize socket at port %d!", hostPort); + AZStd::string errorMsg = AZStd::string::format("Failed to initialize socket at port %d!", hostPort); EBUS_DBG_EVENT(Debug::SessionDrillerBus, OnSessionError, this, errorMsg); EBUS_EVENT_ID(m_gridMate, SessionEventBus, OnSessionError, this, errorMsg); // We can't be a real host if we failed to provide matching services. @@ -899,7 +899,7 @@ LANSession::OnStateHostMigrateSession(AZ::HSM& sm, const AZ::HSM::Event& e) // MakeSessionId // [3/7/2013] //========================================================================= -string +AZStd::string LANSession::MakeSessionId() { char temp[64]; @@ -990,7 +990,7 @@ LANSearch::Update() wb.Write(m_searchParams.m_params[i].m_type); } - string serverAddress = m_searchParams.m_serverAddress; + AZStd::string serverAddress = m_searchParams.m_serverAddress; if (serverAddress.empty()) { serverAddress = Utils::GetBroadcastAddress(m_searchParams.m_familyType); diff --git a/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h b/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h index 20ade42a6e..42524e034a 100644 --- a/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h +++ b/Code/Framework/GridMate/GridMate/Session/LANSessionServiceTypes.h @@ -20,7 +20,7 @@ namespace GridMate : m_port (0) // by default session can't be found (searched for) {} - string m_address; /// empty to accept any address otherwise you can provide a specific bind address. + AZStd::string m_address; /// empty to accept any address otherwise you can provide a specific bind address. /** * Use 0 if you don't want you session to be searchable (default) * Port on which we will register the LAN session (it will be used for session communication and should be different than the game/carrier one). diff --git a/Code/Framework/GridMate/GridMate/Session/Session.cpp b/Code/Framework/GridMate/GridMate/Session/Session.cpp index 8a9bdea273..471e21127c 100644 --- a/Code/Framework/GridMate/GridMate/Session/Session.cpp +++ b/Code/Framework/GridMate/GridMate/Session/Session.cpp @@ -60,7 +60,7 @@ namespace GridMate typedef vector NewConnectionsType; typedef vector UserDataBufferType; - typedef unordered_set AddressSetType; + typedef unordered_set AddressSetType; GridSessionHandshake(unsigned int handshakeTimeoutMS, const VersionType& version); virtual ~GridSessionHandshake() {} @@ -99,12 +99,12 @@ namespace GridMate virtual unsigned int GetHandshakeTimeOutMS() const { return m_handshakeTimeOutMS; } ////////////////////////////////////////////////////////////////////////// - void BanAddress(string address); + void BanAddress(AZStd::string address); void SetHost(bool isHost); void SetInvited(bool isInvited); void SetHostMigration(bool isMigrating); void SetUserData(const void* data, size_t dataSize); - void SetSessionId(string sessionId); + void SetSessionId(AZStd::string sessionId); bool IsNewConnections() { return !m_newConnections.empty(); } NewConnectionsType& AcquireNewConnections(); void ReleaseNewConnections(); @@ -117,7 +117,7 @@ namespace GridMate NewConnectionsType m_newConnections; AddressSetType m_banList; UserDataBufferType m_userData; - string m_sessionId; + AZStd::string m_sessionId; RemotePeerMode m_peerMode; VersionType m_version; @@ -165,7 +165,7 @@ void GridSessionParam::SetValue(AZ::s32* values, size_t numElements) if (numElements > 0) { AZ_Assert(values != nullptr, "Invalid values pointer!"); - string temp; + AZStd::string temp; for (size_t i = 0; i < numElements; ++i) { AZStd::to_string(temp, values[i]); @@ -183,7 +183,7 @@ void GridSessionParam::SetValue(AZ::s64* values, size_t numElements) if (numElements > 0) { AZ_Assert(values != nullptr, "Invalid values pointer!"); - string temp; + AZStd::string temp; for (size_t i = 0; i < numElements; ++i) { AZStd::to_string(temp, values[i]); @@ -201,7 +201,7 @@ void GridSessionParam::SetValue(float* values, size_t numElements) if (numElements > 0) { AZ_Assert(values != nullptr, "Invalid values pointer!"); - string temp; + AZStd::string temp; for (size_t i = 0; i < numElements; ++i) { AZStd::to_string(temp, values[i]); @@ -219,7 +219,7 @@ void GridSessionParam::SetValue(double* values, size_t numElements) if (numElements > 0) { AZ_Assert(values != nullptr, "Invalid values pointer!"); - string temp; + AZStd::string temp; for (size_t i = 0; i < numElements; ++i) { AZStd::to_string(temp, values[i]); @@ -726,7 +726,7 @@ GridSession::RemoveParam(unsigned int index) { const GridSessionReplica::ParamContainer& curParams = m_state->m_params.Get(); const GridSessionParam& foundParam = curParams.at(index); - string paramId = foundParam.m_id; + AZStd::string paramId = foundParam.m_id; m_state->m_params.Modify([=](Internal::GridSessionReplica::ParamContainer& params) { params.erase(¶ms.at(index)); @@ -1220,7 +1220,7 @@ GridSession::OnDriverError(Carrier* carrier, ConnectionID id, const DriverError& return; // not for us } uintptr_t idInt = reinterpret_cast(static_cast(id)); - string errorMsg = string::format("Carrier driver error ConnectionID: %" PRIuPTR "ErrorCode: 0x%08x", idInt, error.m_errorCode); + AZStd::string errorMsg = AZStd::string::format("Carrier driver error ConnectionID: %" PRIuPTR "ErrorCode: 0x%08x", idInt, error.m_errorCode); EBUS_DBG_EVENT(Debug::SessionDrillerBus, OnSessionError, this, errorMsg); EBUS_EVENT_ID(m_gridMate, SessionEventBus, OnSessionError, this, errorMsg); @@ -1248,7 +1248,7 @@ GridSession::OnSecurityError(Carrier* carrier, ConnectionID id, const SecurityEr return; // not for us } uintptr_t idInt = reinterpret_cast(static_cast(id)); - string errorMsg = string::format("Carrier security error ConnectionID: %" PRIuPTR " ErrorCode: 0x%08x", idInt, error.m_errorCode); + AZStd::string errorMsg = AZStd::string::format("Carrier security error ConnectionID: %" PRIuPTR " ErrorCode: 0x%08x", idInt, error.m_errorCode); EBUS_DBG_EVENT(Debug::SessionDrillerBus, OnSessionError, this, errorMsg); } @@ -1976,7 +1976,7 @@ GridMember::GetNatType() const //========================================================================= // GetName //========================================================================= -string +AZStd::string GridMember::GetName() const { return m_clientState ? m_clientState->m_name.Get().c_str() : "Unknown"; @@ -2244,7 +2244,7 @@ GridMember::GetProcessId() const //========================================================================= // GetMachineName //========================================================================= -string +AZStd::string GridMember::GetMachineName() const { if (m_clientState) @@ -2253,7 +2253,7 @@ GridMember::GetMachineName() const } else { - return string(); + return AZStd::string(); } } @@ -2688,7 +2688,7 @@ HandshakeErrorCode GridSessionHandshake::OnReceiveRequest(ConnectionID id, ReadB { (void)id; AZStd::lock_guard l(m_dataLock); - string sessionId; + AZStd::string sessionId; bool isInvited = false; RemotePeerMode peerMode; VersionType version; @@ -2761,7 +2761,7 @@ bool GridSessionHandshake::OnConfirmRequest(ConnectionID id, ReadBuffer& rb) (void)id; AZStd::lock_guard l(m_dataLock); - string sessionId; + AZStd::string sessionId; if (!rb.Read(sessionId)) { return false; @@ -2818,7 +2818,7 @@ void GridSessionHandshake::OnDisconnect(ConnectionID id) //========================================================================= // BanAddress //========================================================================= -void GridSessionHandshake::BanAddress(string address) +void GridSessionHandshake::BanAddress(AZStd::string address) { AZStd::lock_guard l(m_dataLock); m_banList.insert(address); @@ -2864,7 +2864,7 @@ void GridSessionHandshake::SetUserData(const void* data, size_t dataSize) //========================================================================= // SetSessionId //========================================================================= -void GridSessionHandshake::SetSessionId(string sessionId) +void GridSessionHandshake::SetSessionId(AZStd::string sessionId) { AZStd::lock_guard l(m_dataLock); m_sessionId = sessionId; diff --git a/Code/Framework/GridMate/GridMate/Session/Session.h b/Code/Framework/GridMate/GridMate/Session/Session.h index 03556756ba..5080570373 100644 --- a/Code/Framework/GridMate/GridMate/Session/Session.h +++ b/Code/Framework/GridMate/GridMate/Session/Session.h @@ -39,8 +39,8 @@ namespace GridMate struct MemberID { virtual ~MemberID() {} - virtual string ToString() const = 0; - virtual string ToAddress() const = 0; + virtual AZStd::string ToString() const = 0; + virtual AZStd::string ToAddress() const = 0; virtual MemberIDCompact Compact() const = 0; virtual bool IsValid() const = 0; @@ -50,7 +50,7 @@ namespace GridMate AZ_FORCE_INLINE bool operator!=(const MemberIDCompact& rhs) const { return Compact() != rhs; } }; - typedef string SessionID; + typedef AZStd::string SessionID; struct SearchInfo; @@ -87,8 +87,8 @@ namespace GridMate void SetValue(float* values, size_t numElements); void SetValue(double* values, size_t numElements); - string m_id; - string m_value; + AZStd::string m_id; + AZStd::string m_value; AZ::u8 m_type; AZ_FORCE_INLINE bool operator==(const GridSessionParam& rhs) const { return m_type == rhs.m_type && m_id == rhs.m_id && m_value == rhs.m_value; } @@ -303,7 +303,7 @@ namespace GridMate virtual const PlayerId* GetPlayerId() const = 0; NatType GetNatType() const; - string GetName() const; + AZStd::string GetName() const; GridSession* GetSession() const { return m_session; } @@ -353,7 +353,7 @@ namespace GridMate //@{ Platform information AZ::PlatformID GetPlatformId() const; AZ::u32 GetProcessId() const; - string GetMachineName() const; + AZStd::string GetMachineName() const; //@} protected: @@ -568,7 +568,7 @@ namespace GridMate Internal::GridSessionHandshake* m_handshake; typedef unordered_set ConnectionIDSet; ConnectionIDSet m_connections; - string m_hostAddress; + AZStd::string m_hostAddress; bool m_isShutdown; GridMember* m_myMember; ///< Created with the session and bound when the server replica arrives. @@ -923,14 +923,14 @@ namespace GridMate DataSet m_numConnections; DataSet m_natType; - DataSet m_name; + DataSet m_name; DataSet m_memberId; DataSet m_newHostVote; ///< Used when in host migration, to cast machine's vote. MuteDataSetType m_muteList; ///< List of all players we have muted. // Platform and application informational data DataSet > m_platformId; - DataSet m_machineName; + DataSet m_machineName; DataSet m_processId; DataSet m_isInvited; }; diff --git a/Code/Framework/GridMate/GridMate/String/StringUtils.h b/Code/Framework/GridMate/GridMate/String/StringUtils.h deleted file mode 100644 index 6f1ca89b0b..0000000000 --- a/Code/Framework/GridMate/GridMate/String/StringUtils.h +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once - -#include diff --git a/Code/Framework/GridMate/GridMate/String/string.h b/Code/Framework/GridMate/GridMate/String/string.h deleted file mode 100644 index 779f5034c5..0000000000 --- a/Code/Framework/GridMate/GridMate/String/string.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#ifndef GM_CONTAINERS_STRING_H -#define GM_CONTAINERS_STRING_H - -#include -#include -#include // for getting from string->wstring and backwards - -namespace GridMate -{ - /** - * All libs should use specialized allocators - */ - typedef AZStd::basic_string, SysContAlloc > string; - typedef AZStd::basic_string, SysContAlloc > wstring; - - typedef AZStd::basic_string, GridMateStdAlloc > gridmate_string; - typedef AZStd::basic_string, GridMateStdAlloc > gridmate_wstring; -} -#endif // GM_CONTAINERS_STRING_H diff --git a/Code/Framework/GridMate/GridMate/VoiceChat/VoiceChatServiceBus.h b/Code/Framework/GridMate/GridMate/VoiceChat/VoiceChatServiceBus.h index 98fcd48b85..b5c09a411a 100644 --- a/Code/Framework/GridMate/GridMate/VoiceChat/VoiceChatServiceBus.h +++ b/Code/Framework/GridMate/GridMate/VoiceChat/VoiceChatServiceBus.h @@ -10,7 +10,6 @@ #include #include -#include namespace GridMate { diff --git a/Code/Framework/GridMate/GridMate/gridmate_files.cmake b/Code/Framework/GridMate/GridMate/gridmate_files.cmake index 8c94fe80ad..e318a8adcd 100644 --- a/Code/Framework/GridMate/GridMate/gridmate_files.cmake +++ b/Code/Framework/GridMate/GridMate/gridmate_files.cmake @@ -120,6 +120,5 @@ set(FILES Session/Session.cpp Session/Session.h Session/SessionServiceBus.h - String/string.h VoiceChat/VoiceChatServiceBus.h ) diff --git a/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp b/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp index e70e839d42..05fb56dfc1 100644 --- a/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp +++ b/Code/Framework/GridMate/Platform/Android/GridMate/Session/LANSession_Android.cpp @@ -6,19 +6,18 @@ * */ -#include #include namespace GridMate { namespace Platform { - void AssignExtendedName(GridMate::string& extendedName) + void AssignExtendedName(AZStd::string& extendedName) { char hostName[64]; gethostname(hostName, AZ_ARRAY_SIZE(hostName)); - extendedName = GridMate::string::format("%s", hostName); + extendedName = AZStd::string::format("%s", hostName); } } } diff --git a/Code/Framework/GridMate/Platform/Common/UnixLike/GridMate/Carrier/Utils_UnixLike.cpp b/Code/Framework/GridMate/Platform/Common/UnixLike/GridMate/Carrier/Utils_UnixLike.cpp index ea824e7564..7d04ff640b 100644 --- a/Code/Framework/GridMate/Platform/Common/UnixLike/GridMate/Carrier/Utils_UnixLike.cpp +++ b/Code/Framework/GridMate/Platform/Common/UnixLike/GridMate/Carrier/Utils_UnixLike.cpp @@ -18,9 +18,9 @@ namespace GridMate { - string Utils::GetMachineAddress(int familyType) + AZStd::string Utils::GetMachineAddress(int familyType) { - string machineName; + AZStd::string machineName; struct ifaddrs* ifAddrStruct = nullptr; struct ifaddrs* ifa = nullptr; diff --git a/Code/Framework/GridMate/Platform/Common/WinAPI/GridMate/Carrier/Utils_WinAPI.cpp b/Code/Framework/GridMate/Platform/Common/WinAPI/GridMate/Carrier/Utils_WinAPI.cpp index dd9b737180..095f8ba6c7 100644 --- a/Code/Framework/GridMate/Platform/Common/WinAPI/GridMate/Carrier/Utils_WinAPI.cpp +++ b/Code/Framework/GridMate/Platform/Common/WinAPI/GridMate/Carrier/Utils_WinAPI.cpp @@ -16,9 +16,9 @@ namespace GridMate { - string Utils::GetMachineAddress(int familyType) + AZStd::string Utils::GetMachineAddress(int familyType) { - string machineName; + AZStd::string machineName; char name[MAX_PATH]; int result = gethostname(name, sizeof(name)); AZ_Error("GridMate", result == 0, "Failed in gethostname with result=%d, WSAGetLastError=%d!", result, WSAGetLastError()); diff --git a/Code/Framework/GridMate/Platform/Linux/GridMate/Session/LANSession_Linux.cpp b/Code/Framework/GridMate/Platform/Linux/GridMate/Session/LANSession_Linux.cpp index e70e839d42..05fb56dfc1 100644 --- a/Code/Framework/GridMate/Platform/Linux/GridMate/Session/LANSession_Linux.cpp +++ b/Code/Framework/GridMate/Platform/Linux/GridMate/Session/LANSession_Linux.cpp @@ -6,19 +6,18 @@ * */ -#include #include namespace GridMate { namespace Platform { - void AssignExtendedName(GridMate::string& extendedName) + void AssignExtendedName(AZStd::string& extendedName) { char hostName[64]; gethostname(hostName, AZ_ARRAY_SIZE(hostName)); - extendedName = GridMate::string::format("%s", hostName); + extendedName = AZStd::string::format("%s", hostName); } } } diff --git a/Code/Framework/GridMate/Platform/Linux/GridMate/String/StringUtils_Platform.h b/Code/Framework/GridMate/Platform/Linux/GridMate/String/StringUtils_Platform.h deleted file mode 100644 index 03320d1dd8..0000000000 --- a/Code/Framework/GridMate/Platform/Linux/GridMate/String/StringUtils_Platform.h +++ /dev/null @@ -1,8 +0,0 @@ -/* - * Copyright (c) Contributors to the Open 3D Engine Project. - * For complete copyright and license terms please see the LICENSE at the root of this distribution. - * - * SPDX-License-Identifier: Apache-2.0 OR MIT - * - */ -#pragma once diff --git a/Code/Framework/GridMate/Platform/Mac/GridMate/Session/LANSession_Mac.cpp b/Code/Framework/GridMate/Platform/Mac/GridMate/Session/LANSession_Mac.cpp index e70e839d42..05fb56dfc1 100644 --- a/Code/Framework/GridMate/Platform/Mac/GridMate/Session/LANSession_Mac.cpp +++ b/Code/Framework/GridMate/Platform/Mac/GridMate/Session/LANSession_Mac.cpp @@ -6,19 +6,18 @@ * */ -#include #include namespace GridMate { namespace Platform { - void AssignExtendedName(GridMate::string& extendedName) + void AssignExtendedName(AZStd::string& extendedName) { char hostName[64]; gethostname(hostName, AZ_ARRAY_SIZE(hostName)); - extendedName = GridMate::string::format("%s", hostName); + extendedName = AZStd::string::format("%s", hostName); } } } diff --git a/Code/Framework/GridMate/Platform/Windows/GridMate/Session/LANSession_Windows.cpp b/Code/Framework/GridMate/Platform/Windows/GridMate/Session/LANSession_Windows.cpp index 59a1c65781..8925746a79 100644 --- a/Code/Framework/GridMate/Platform/Windows/GridMate/Session/LANSession_Windows.cpp +++ b/Code/Framework/GridMate/Platform/Windows/GridMate/Session/LANSession_Windows.cpp @@ -6,15 +6,15 @@ * */ -#include #include #include +#include namespace GridMate { namespace Platform { - void AssignExtendedName(GridMate::string& extendedName) + void AssignExtendedName(AZStd::string& extendedName) { char hostName[64]; gethostname(hostName, AZ_ARRAY_SIZE(hostName)); @@ -31,7 +31,7 @@ namespace GridMate azsnprintf(procName, AZ_ARRAY_SIZE(procName), "Unknown"); } - extendedName = GridMate::string::format("%s::%s", hostName, procName); + extendedName = AZStd::string::format("%s::%s", hostName, procName); } } } diff --git a/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp b/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp index e70e839d42..05fb56dfc1 100644 --- a/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp +++ b/Code/Framework/GridMate/Platform/iOS/GridMate/Session/LANSession_iOS.cpp @@ -6,19 +6,18 @@ * */ -#include #include namespace GridMate { namespace Platform { - void AssignExtendedName(GridMate::string& extendedName) + void AssignExtendedName(AZStd::string& extendedName) { char hostName[64]; gethostname(hostName, AZ_ARRAY_SIZE(hostName)); - extendedName = GridMate::string::format("%s", hostName); + extendedName = AZStd::string::format("%s", hostName); } } } diff --git a/Code/Framework/GridMate/Tests/Carrier.cpp b/Code/Framework/GridMate/Tests/Carrier.cpp index 45cb16dbb2..8d3ec4eef6 100644 --- a/Code/Framework/GridMate/Tests/Carrier.cpp +++ b/Code/Framework/GridMate/Tests/Carrier.cpp @@ -193,7 +193,7 @@ namespace UnitTest CarrierCallbacksHandler clientCB, serverCB; TestCarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier test!"); + AZStd::string str("Hello this is a carrier test!"); const char* targetAddress = "127.0.0.1"; @@ -377,7 +377,7 @@ namespace UnitTest CarrierCallbacksHandler clientCB, serverCB; TestCarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier test!"); + AZStd::string str("Hello this is a carrier test!"); clientCarrierDesc.m_driver = SocketProvider::CreateDriverForJoin(); serverCarrierDesc.m_driver = SocketProvider::CreateDriverForHost(); @@ -469,7 +469,7 @@ namespace UnitTest CarrierCallbacksHandler clientCB, serverCB; TestCarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier stress test!"); + AZStd::string str("Hello this is a carrier stress test!"); clientCarrierDesc.m_enableDisconnectDetection = false; serverCarrierDesc.m_enableDisconnectDetection = false; @@ -1401,7 +1401,7 @@ namespace UnitTest CarrierCallbacksHandler clientCB, serverCB; CarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier test!"); + AZStd::string str("Hello this is a carrier test!"); const char* targetAddress = "127.0.0.1"; diff --git a/Code/Framework/GridMate/Tests/CarrierStreamSocketDriverTests.cpp b/Code/Framework/GridMate/Tests/CarrierStreamSocketDriverTests.cpp index aac15562df..6af6a6ab87 100644 --- a/Code/Framework/GridMate/Tests/CarrierStreamSocketDriverTests.cpp +++ b/Code/Framework/GridMate/Tests/CarrierStreamSocketDriverTests.cpp @@ -188,7 +188,7 @@ namespace UnitTest CarrierStreamCallbacksHandler clientCB, serverCB; TestCarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier test!"); + AZStd::string str("Hello this is a carrier test!"); const char* targetAddress = "127.0.0.1"; @@ -374,7 +374,7 @@ namespace UnitTest CarrierStreamCallbacksHandler clientCB, serverCB; TestCarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier test!"); + AZStd::string str("Hello this is a carrier test!"); clientCarrierDesc.m_driver = CreateDriverForJoin(clientCarrierDesc); serverCarrierDesc.m_driver = CreateDriverForHost(serverCarrierDesc); @@ -475,7 +475,7 @@ namespace UnitTest CarrierStreamCallbacksHandler clientCB, serverCB; UnitTest::TestCarrierDesc serverCarrierDesc, clientCarrierDesc; - string str("Hello this is a carrier stress test!"); + AZStd::string str("Hello this is a carrier stress test!"); clientCarrierDesc.m_enableDisconnectDetection = /*false*/ true; serverCarrierDesc.m_enableDisconnectDetection = /*false*/ true; diff --git a/Code/Framework/GridMate/Tests/Replica.cpp b/Code/Framework/GridMate/Tests/Replica.cpp index 0b8fab10ce..83a3a1f5a1 100644 --- a/Code/Framework/GridMate/Tests/Replica.cpp +++ b/Code/Framework/GridMate/Tests/Replica.cpp @@ -3687,7 +3687,7 @@ public: void Touch() { - string randomStr; + AZStd::string randomStr; for (unsigned i = 0; i < k_strSize; ++i) { randomStr += 'a' + (rand() % 26); @@ -3698,7 +3698,7 @@ public: bool IsReplicaMigratable() override { return false; } static const unsigned k_strSize = 64; - DataSet m_value; + DataSet m_value; }; void run() diff --git a/Code/Framework/GridMate/Tests/Serialize.cpp b/Code/Framework/GridMate/Tests/Serialize.cpp index 4c74e9526a..9a681dc018 100644 --- a/Code/Framework/GridMate/Tests/Serialize.cpp +++ b/Code/Framework/GridMate/Tests/Serialize.cpp @@ -471,12 +471,12 @@ namespace UnitTest // ------------------------------------ // String { - string s = "hello"; + AZStd::string s = "hello"; wb.Write(s); AZ_TEST_ASSERT(wb.Size() == s.length() + sizeof(AZ::u16)); - string rs; + AZStd::string rs; rb = ReadBuffer(wb.GetEndianType(), wb.Get(), wb.Size()); rb.Read(rs); AZ_TEST_ASSERT(rs == s); diff --git a/Code/Framework/GridMate/Tests/TestProfiler.cpp b/Code/Framework/GridMate/Tests/TestProfiler.cpp index 9f79d5a9fe..26e9312ecf 100644 --- a/Code/Framework/GridMate/Tests/TestProfiler.cpp +++ b/Code/Framework/GridMate/Tests/TestProfiler.cpp @@ -34,15 +34,15 @@ static bool CollectPerformanceCounters(const AZ::Debug::ProfilerRegister& reg, c return true; } -static string FormatString(const AZStd::string& pre, const AZStd::string& name, const AZStd::string& post, AZ::u64 time, AZ::u64 calls) +static AZStd::string FormatString(const AZStd::string& pre, const AZStd::string& name, const AZStd::string& post, AZ::u64 time, AZ::u64 calls) { - string units = "us"; + AZStd::string units = "us"; if (AZ::u64 divtime = time / 1000) { time = divtime; units = "ms"; } - return string::format("%s%s %s %10llu%s (%llu calls)\n", pre.c_str(), name.c_str(), post.c_str(), time, units.c_str(), calls); + return AZStd::string::format("%s%s %s %10llu%s (%llu calls)\n", pre.c_str(), name.c_str(), post.c_str(), time, units.c_str(), calls); } struct TotalSortContainer @@ -56,28 +56,28 @@ struct TotalSortContainer { if (m_self && level >= 0) { - string levelIndent; + AZStd::string levelIndent; for (AZ::s32 i = 0; i < level; i++) { levelIndent += (i == level - 1) ? "+---" : "| "; } - string name = m_self->m_name ? m_self->m_name : m_self->m_function; - string outputTotal = FormatString(levelIndent, name, " Total:", m_self->m_timeData.m_time, m_self->m_timeData.m_calls); + AZStd::string name = m_self->m_name ? m_self->m_name : m_self->m_function; + AZStd::string outputTotal = FormatString(levelIndent, name, " Total:", m_self->m_timeData.m_time, m_self->m_timeData.m_calls); AZ_Printf(systemId, outputTotal.c_str()); if (m_self->m_timeData.m_childrenTime || m_self->m_timeData.m_childrenCalls) { - string childIndent = levelIndent; + AZStd::string childIndent = levelIndent; for (auto i = name.begin(); i != name.end(); ++i) { childIndent += " "; } childIndent[level * 4] = '|'; - string outputChild = FormatString(childIndent, "", "Child:", m_self->m_timeData.m_childrenTime, m_self->m_timeData.m_childrenCalls); + AZStd::string outputChild = FormatString(childIndent, "", "Child:", m_self->m_timeData.m_childrenTime, m_self->m_timeData.m_childrenCalls); AZ_Printf(systemId, outputChild.c_str()); - string outputSelf = FormatString(childIndent, "", "Self :", m_self->m_timeData.m_time - m_self->m_timeData.m_childrenTime, m_self->m_timeData.m_calls); + AZStd::string outputSelf = FormatString(childIndent, "", "Self :", m_self->m_timeData.m_time - m_self->m_timeData.m_childrenTime, m_self->m_timeData.m_calls); AZ_Printf(systemId, outputSelf.c_str()); } } @@ -237,7 +237,7 @@ void TestProfiler::PrintProfilingSelf(const char* systemId) AZ_Printf(systemId, "Profiling timers by exclusive execution time:\n"); for (auto profiler : selfSorted) { - string str = FormatString("", profiler->m_name ? profiler->m_name : profiler->m_function, "Self Time:", + AZStd::string str = FormatString("", profiler->m_name ? profiler->m_name : profiler->m_function, "Self Time:", profiler->m_timeData.m_time - profiler->m_timeData.m_childrenTime, profiler->m_timeData.m_calls); AZ_Printf(systemId, str.c_str()); }