Skip to content

Commit

Permalink
Removed using namespace std from all files
Browse files Browse the repository at this point in the history
  • Loading branch information
jadhavrohit924 committed Sep 24, 2024
1 parent fbc0d21 commit 4d6825c
Show file tree
Hide file tree
Showing 39 changed files with 23 additions and 64 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <app/util/config.h>
#include <static-supported-modes-manager.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::ModeSelect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app/util/config.h>
#include <static-supported-temperature-levels.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::TemperatureControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#ifdef MATTER_DM_PLUGIN_AUDIO_OUTPUT_SERVER
#include "AudioOutputManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::AudioOutput;
using chip::app::AttributeValueEncoder;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#ifdef MATTER_DM_PLUGIN_MEDIA_INPUT_SERVER
#include "MediaInputManager.h"

using namespace std;
using namespace chip;
using namespace chip::app::Clusters::MediaInput;
using Protocols::InteractionModel::Status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#ifdef MATTER_DM_PLUGIN_MEDIA_PLAYBACK_SERVER
#include "MediaPlaybackManager.h"

using namespace std;
using namespace chip;
using namespace chip::app;
using namespace chip::app::DataModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <list>
#include <string>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::TargetNavigator;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <app/util/config.h>
#include <static-supported-modes-manager.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::ModeSelect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app/util/config.h>
#include <static-supported-temperature-levels.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::TemperatureControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app/util/config.h>
#include <static-supported-temperature-levels.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::TemperatureControl;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <json/json.h>
#include <lib/core/DataModelTypes.h>

using namespace std;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::AccountLogin;
using Status = chip::Protocols::InteractionModel::Status;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "ApplicationBasicManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::ApplicationBasic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "AudioOutputManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::AudioOutput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters::ContentAppObserver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::DataModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
#include <list>
#include <string>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::DataModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

#include <string>

using namespace std;
using namespace chip;
using namespace chip::app;
using namespace chip::app::DataModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

#include "MessagesManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::Messages;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include <list>
#include <string>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::TargetNavigator;
using ContentAppAttributeDelegate = chip::AppPlatform::ContentAppAttributeDelegate;
Expand Down
1 change: 0 additions & 1 deletion examples/tv-app/android/java/ContentLauncherManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>

using namespace std;
using namespace chip;
using namespace chip::app::DataModel;
using namespace chip::app::Clusters::ContentLauncher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <lib/support/JniReferences.h>
#include <lib/support/JniTypeWrappers.h>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::ApplicationLauncher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
#include <app/CommandHandler.h>
#include <app/util/config.h>

using namespace std;
using namespace chip::app::Clusters::AccountLogin;

AccountLoginManager::AccountLoginManager(const char * setupPin)
Expand All @@ -32,8 +31,8 @@ AccountLoginManager::AccountLoginManager(const char * setupPin)
bool AccountLoginManager::HandleLogin(const CharSpan & tempAccountIdentifier, const CharSpan & setupPin,
const chip::Optional<chip::NodeId> & nodeId)
{
string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size());
string setupPinString(setupPin.data(), setupPin.size());
std::string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size());
std::string setupPinString(setupPin.data(), setupPin.size());
ChipLogProgress(Zcl, "temporary account id: %s", tempAccountIdentifierString.c_str());
ChipLogProgress(Zcl, "setup pin %s", setupPinString.c_str());

Expand All @@ -57,7 +56,7 @@ bool AccountLoginManager::HandleLogout(const chip::Optional<chip::NodeId> & node
void AccountLoginManager::HandleGetSetupPin(CommandResponseHelper<GetSetupPINResponse> & helper,
const CharSpan & tempAccountIdentifier)
{
string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size());
std::string tempAccountIdentifierString(tempAccountIdentifier.data(), tempAccountIdentifier.size());

GetSetupPINResponse response;
ChipLogProgress(Zcl, "temporary account id: %s returning pin: %s", tempAccountIdentifierString.c_str(), mSetupPin);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "ApplicationBasicManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::ApplicationBasic;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "ApplicationLauncherManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::ApplicationLauncher;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

#include "AudioOutputManager.h"

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters::AudioOutput;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>

using namespace std;
using namespace chip;
using namespace chip::app::Clusters::ContentAppObserver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#include <app-common/zap-generated/attributes/Accessors.h>
#include <app/util/config.h>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::DataModel;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,12 @@
#include <list>
#include <string>

using namespace std;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::DataModel;
using namespace chip::app::Clusters::ContentLauncher;

ContentLauncherManager::ContentLauncherManager(list<std::string> acceptHeaderList, uint32_t supportedStreamingProtocols)
ContentLauncherManager::ContentLauncherManager(std::list<std::string> acceptHeaderList, uint32_t supportedStreamingProtocols)
{
mAcceptHeaderList = acceptHeaderList;
mSupportedStreamingProtocols = supportedStreamingProtocols;
Expand Down Expand Up @@ -103,7 +102,7 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper<LaunchRes
bool useCurrentContext)
{
ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchContent");
string dataString(data.data(), data.size());
std::string dataString(data.data(), data.size());

ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchContent TEST CASE autoplay=%d data=%s ", (autoplay ? 1 : 0),
dataString.c_str());
Expand All @@ -122,8 +121,8 @@ void ContentLauncherManager::HandleLaunchContent(CommandResponseHelper<LaunchRes
{
if (parameter.type == parameterType.type)
{
string val1(parameter.value.data(), parameter.value.size());
string val2(parameterType.value.data(), parameterType.value.size());
std::string val1(parameter.value.data(), parameter.value.size());
std::string val2(parameterType.value.data(), parameterType.value.size());
if (strcmp(val1.c_str(), val2.c_str()) == 0)
{
ChipLogProgress(Zcl, " TEST CASE found match=%s type=%d", contentEntry.mName.c_str(),
Expand Down Expand Up @@ -152,9 +151,9 @@ void ContentLauncherManager::HandleLaunchUrl(CommandResponseHelper<LaunchRespons
{
ChipLogProgress(Zcl, "ContentLauncherManager::HandleLaunchUrl");

string contentUrlString(contentUrl.data(), contentUrl.size());
string displayStringString(displayString.data(), displayString.size());
string providerNameString(brandingInformation.providerName.data(), brandingInformation.providerName.size());
std::string contentUrlString(contentUrl.data(), contentUrl.size());
std::string displayStringString(displayString.data(), displayString.size());
std::string providerNameString(brandingInformation.providerName.data(), brandingInformation.providerName.size());

ChipLogProgress(
Zcl, "ContentLauncherManager::HandleLaunchUrl TEST CASE ContentURL=%s DisplayString=%s BrandingInformation.ProviderName=%s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ using namespace chip::app::Clusters::DishwasherAlarm;
using namespace chip::app::Clusters::DishwasherAlarm::Attributes;
using namespace chip::DeviceLayer;
using chip::Protocols::InteractionModel::Status;
using namespace std;

static constexpr size_t kDishwasherAlarmDelegateTableSize =
MATTER_DM_DISHWASHER_ALARM_CLUSTER_SERVER_ENDPOINT_COUNT + CHIP_DEVICE_CONFIG_DYNAMIC_ENDPOINT_COUNT;
Expand Down
1 change: 0 additions & 1 deletion src/app/clusters/mode-select-server/mode-select-server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#include <app/clusters/on-off-server/on-off-server.h>
#endif // MATTER_DM_PLUGIN_ON_OFF

using namespace std;
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ using namespace chip::app::Clusters::RefrigeratorAlarm::Attributes;
using namespace chip::DeviceLayer;
using chip::Protocols::InteractionModel::Status;

using namespace std;
RefrigeratorAlarmServer RefrigeratorAlarmServer::instance;

RefrigeratorAlarmServer & RefrigeratorAlarmServer::Instance()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
#include <protocols/interaction_model/StatusCode.h>

// using namespace std;
using namespace chip;
using namespace chip::app;
using namespace chip::app::Clusters;
using namespace chip::app::Clusters::ResourceMonitoring;
Expand Down
11 changes: 5 additions & 6 deletions src/lib/dnssd/minimal_mdns/tests/FuzzPacketParsingPW.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
namespace {

using namespace fuzztest;
using namespace std;

using namespace chip;
using namespace mdns::Minimal;
Expand Down Expand Up @@ -65,16 +64,16 @@ void PacketParserFuzz(const std::vector<std::uint8_t> & bytes)
mdns::Minimal::ParsePacket(packet, &delegate);
}

FUZZ_TEST(MinimalmDNS, PacketParserFuzz).WithDomains(Arbitrary<vector<uint8_t>>());
FUZZ_TEST(MinimalmDNS, PacketParserFuzz).WithDomains(Arbitrary<std::vector<uint8_t>>());

class TxtRecordAccumulator : public TxtRecordDelegate
{
public:
using DataType = vector<pair<string, string>>;
using DataType = std::vector<std::pair<std::string, std::string>>;

void OnRecord(const BytesRange & name, const BytesRange & value) override
{
mData.push_back(make_pair(AsString(name), AsString(value)));
mData.push_back(std::make_pair(AsString(name), AsString(value)));
}

DataType & Data() { return mData; }
Expand All @@ -83,9 +82,9 @@ class TxtRecordAccumulator : public TxtRecordDelegate
private:
DataType mData;

static string AsString(const BytesRange & range)
static std::string AsString(const BytesRange & range)
{
return string(reinterpret_cast<const char *>(range.Start()), reinterpret_cast<const char *>(range.End()));
return std::string(reinterpret_cast<const char *>(range.Start()), reinterpret_cast<const char *>(range.End()));
}
};

Expand Down
1 change: 0 additions & 1 deletion src/lib/dnssd/minimal_mdns/tests/TestAdvertiser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

namespace {

using namespace std;
using namespace chip;
using namespace chip::Dnssd;
using namespace mdns::Minimal;
Expand Down
Loading

0 comments on commit 4d6825c

Please sign in to comment.