THRIFT-270: change cpp namespaces from facebook::thrift to apache::thrift
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@739644 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/protocol/TBase64Utils.cpp b/lib/cpp/src/protocol/TBase64Utils.cpp
index beb659f..b294eec 100644
--- a/lib/cpp/src/protocol/TBase64Utils.cpp
+++ b/lib/cpp/src/protocol/TBase64Utils.cpp
@@ -10,7 +10,7 @@
using std::string;
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
static const uint8_t *kBase64EncodeTable = (const uint8_t *)
@@ -63,4 +63,4 @@
}
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
diff --git a/lib/cpp/src/protocol/TBase64Utils.h b/lib/cpp/src/protocol/TBase64Utils.h
index ec3daf3..f81476d 100644
--- a/lib/cpp/src/protocol/TBase64Utils.h
+++ b/lib/cpp/src/protocol/TBase64Utils.h
@@ -9,7 +9,7 @@
#include <string>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
// in must be at least len bytes
// len must be 1, 2, or 3
@@ -23,6 +23,6 @@
// no '=' padding should be included in the input
void base64_decode(uint8_t *buf, uint32_t len);
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #define _THRIFT_PROTOCOL_TBASE64UTILS_H_
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.cpp b/lib/cpp/src/protocol/TBinaryProtocol.cpp
index 2962180..2da5c11 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.cpp
+++ b/lib/cpp/src/protocol/TBinaryProtocol.cpp
@@ -51,7 +51,7 @@
}
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
uint32_t TBinaryProtocol::writeMessageBegin(const std::string& name,
const TMessageType messageType,
@@ -419,4 +419,4 @@
return (uint32_t)size;
}
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
diff --git a/lib/cpp/src/protocol/TBinaryProtocol.h b/lib/cpp/src/protocol/TBinaryProtocol.h
index a6a8983..b38b493 100644
--- a/lib/cpp/src/protocol/TBinaryProtocol.h
+++ b/lib/cpp/src/protocol/TBinaryProtocol.h
@@ -11,7 +11,7 @@
#include <boost/shared_ptr.hpp>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
/**
* The default binary protocol for thrift. Writes all data in a very basic
@@ -237,6 +237,6 @@
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_
diff --git a/lib/cpp/src/protocol/TDebugProtocol.cpp b/lib/cpp/src/protocol/TDebugProtocol.cpp
index 92e9d36..05291ef 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.cpp
+++ b/lib/cpp/src/protocol/TDebugProtocol.cpp
@@ -25,7 +25,7 @@
}
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
string TDebugProtocol::fieldTypeName(TType type) {
switch (type) {
@@ -330,4 +330,4 @@
return TDebugProtocol::writeString(str);
}
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
diff --git a/lib/cpp/src/protocol/TDebugProtocol.h b/lib/cpp/src/protocol/TDebugProtocol.h
index dbad1e3..fa4b807 100644
--- a/lib/cpp/src/protocol/TDebugProtocol.h
+++ b/lib/cpp/src/protocol/TDebugProtocol.h
@@ -12,7 +12,7 @@
#include <boost/shared_ptr.hpp>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
/*
@@ -153,18 +153,18 @@
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
// TODO(dreiss): Move (part of) ThriftDebugString into a .cpp file and remove this.
#include <transport/TBufferTransports.h>
-namespace facebook { namespace thrift {
+namespace apache { namespace thrift {
template<typename ThriftStruct>
std::string ThriftDebugString(const ThriftStruct& ts) {
- using namespace facebook::thrift::transport;
- using namespace facebook::thrift::protocol;
+ using namespace apache::thrift::transport;
+ using namespace apache::thrift::protocol;
TMemoryBuffer* buffer = new TMemoryBuffer;
boost::shared_ptr<TTransport> trans(buffer);
TDebugProtocol protocol(trans);
@@ -181,8 +181,8 @@
#if 0
template<typename Object>
std::string DebugString(const std::vector<Object>& vec) {
- using namespace facebook::thrift::transport;
- using namespace facebook::thrift::protocol;
+ using namespace apache::thrift::transport;
+ using namespace apache::thrift::protocol;
TMemoryBuffer* buffer = new TMemoryBuffer;
boost::shared_ptr<TTransport> trans(buffer);
TDebugProtocol protocol(trans);
@@ -205,7 +205,7 @@
}
#endif // 0
-}} // facebook::thrift
+}} // apache::thrift
#endif // #ifndef _THRIFT_PROTOCOL_TDEBUGPROTOCOL_H_
diff --git a/lib/cpp/src/protocol/TDenseProtocol.cpp b/lib/cpp/src/protocol/TDenseProtocol.cpp
index d1602a0..70059b3 100644
--- a/lib/cpp/src/protocol/TDenseProtocol.cpp
+++ b/lib/cpp/src/protocol/TDenseProtocol.cpp
@@ -104,10 +104,10 @@
#define UNLIKELY(val) (val)
#endif
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
const int TDenseProtocol::FP_PREFIX_LEN =
- facebook::thrift::reflection::local::FP_PREFIX_LEN;
+ apache::thrift::reflection::local::FP_PREFIX_LEN;
// Top TypeSpec. TypeSpec of the structure being encoded.
#define TTS (ts_stack_.back()) // type = TypeSpec*
@@ -746,4 +746,4 @@
return xfer + readStringBody(str, size);
}
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
diff --git a/lib/cpp/src/protocol/TDenseProtocol.h b/lib/cpp/src/protocol/TDenseProtocol.h
index 5dd5a8c..4692132 100644
--- a/lib/cpp/src/protocol/TDenseProtocol.h
+++ b/lib/cpp/src/protocol/TDenseProtocol.h
@@ -9,7 +9,7 @@
#include "TBinaryProtocol.h"
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
/**
* !!!WARNING!!!
@@ -51,7 +51,7 @@
static const int32_t VERSION_2 = 0x80020000;
public:
- typedef facebook::thrift::reflection::local::TypeSpec TypeSpec;
+ typedef apache::thrift::reflection::local::TypeSpec TypeSpec;
static const int FP_PREFIX_LEN;
/**
@@ -236,6 +236,6 @@
bool standalone_;
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #ifndef _THRIFT_PROTOCOL_TDENSEPROTOCOL_H_
diff --git a/lib/cpp/src/protocol/TJSONProtocol.cpp b/lib/cpp/src/protocol/TJSONProtocol.cpp
index ca3a51f..01fe471 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/lib/cpp/src/protocol/TJSONProtocol.cpp
@@ -11,9 +11,9 @@
#include "TBase64Utils.h"
#include <transport/TTransportException.h>
-using namespace facebook::thrift::transport;
+using namespace apache::thrift::transport;
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
// Static data
@@ -874,7 +874,7 @@
// Check if we hit the end of the list
uint8_t ch = reader_.peek();
if (ch == kJSONObjectEnd) {
- fieldType = facebook::thrift::protocol::T_STOP;
+ fieldType = apache::thrift::protocol::T_STOP;
}
else {
uint64_t tmpVal = 0;
@@ -982,4 +982,4 @@
return readJSONBase64(str);
}
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
diff --git a/lib/cpp/src/protocol/TJSONProtocol.h b/lib/cpp/src/protocol/TJSONProtocol.h
index cbf4ef8..4287adf 100644
--- a/lib/cpp/src/protocol/TJSONProtocol.h
+++ b/lib/cpp/src/protocol/TJSONProtocol.h
@@ -11,7 +11,7 @@
#include <stack>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
// Forward declaration
class TJSONContext;
@@ -299,18 +299,18 @@
}
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
// TODO(dreiss): Move part of ThriftJSONString into a .cpp file and remove this.
#include <transport/TBufferTransports.h>
-namespace facebook { namespace thrift {
+namespace apache { namespace thrift {
template<typename ThriftStruct>
std::string ThriftJSONString(const ThriftStruct& ts) {
- using namespace facebook::thrift::transport;
- using namespace facebook::thrift::protocol;
+ using namespace apache::thrift::transport;
+ using namespace apache::thrift::protocol;
TMemoryBuffer* buffer = new TMemoryBuffer;
boost::shared_ptr<TTransport> trans(buffer);
TJSONProtocol protocol(trans);
@@ -323,6 +323,6 @@
return std::string((char*)buf, (unsigned int)size);
}
-}} // facebook::thrift
+}} // apache::thrift
#endif // #define _THRIFT_PROTOCOL_TJSONPROTOCOL_H_ 1
diff --git a/lib/cpp/src/protocol/TOneWayProtocol.h b/lib/cpp/src/protocol/TOneWayProtocol.h
index dda113f..ad5f8fa 100644
--- a/lib/cpp/src/protocol/TOneWayProtocol.h
+++ b/lib/cpp/src/protocol/TOneWayProtocol.h
@@ -9,7 +9,7 @@
#include "TProtocol.h"
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
/**
* Abstract class for implementing a protocol that can only be written,
@@ -288,6 +288,6 @@
std::string subclass_;
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #ifndef _THRIFT_PROTOCOL_TBINARYPROTOCOL_H_
diff --git a/lib/cpp/src/protocol/TProtocol.h b/lib/cpp/src/protocol/TProtocol.h
index 1e9ce99..e4cfe0f 100644
--- a/lib/cpp/src/protocol/TProtocol.h
+++ b/lib/cpp/src/protocol/TProtocol.h
@@ -17,9 +17,9 @@
#include <string>
#include <map>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
-using facebook::thrift::transport::TTransport;
+using apache::thrift::transport::TTransport;
#ifdef HAVE_ENDIAN_H
#include <endian.h>
@@ -352,6 +352,6 @@
virtual boost::shared_ptr<TProtocol> getProtocol(boost::shared_ptr<TTransport> trans) = 0;
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #define _THRIFT_PROTOCOL_TPROTOCOL_H_ 1
diff --git a/lib/cpp/src/protocol/TProtocolException.h b/lib/cpp/src/protocol/TProtocolException.h
index b3146d5..be0767b 100644
--- a/lib/cpp/src/protocol/TProtocolException.h
+++ b/lib/cpp/src/protocol/TProtocolException.h
@@ -9,7 +9,7 @@
#include <string>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
/**
* Class to encapsulate all the possible types of protocol errors that may
@@ -20,7 +20,7 @@
*
* @author Mark Slee <mcslee@facebook.com>
*/
-class TProtocolException : public facebook::thrift::TException {
+class TProtocolException : public apache::thrift::TException {
public:
/**
@@ -36,19 +36,19 @@
};
TProtocolException() :
- facebook::thrift::TException(),
+ apache::thrift::TException(),
type_(UNKNOWN) {}
TProtocolException(TProtocolExceptionType type) :
- facebook::thrift::TException(),
+ apache::thrift::TException(),
type_(type) {}
TProtocolException(const std::string& message) :
- facebook::thrift::TException(message),
+ apache::thrift::TException(message),
type_(UNKNOWN) {}
TProtocolException(TProtocolExceptionType type, const std::string& message) :
- facebook::thrift::TException(message),
+ apache::thrift::TException(message),
type_(type) {}
virtual ~TProtocolException() throw() {}
@@ -87,6 +87,6 @@
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #ifndef _THRIFT_PROTOCOL_TPROTOCOLEXCEPTION_H_
diff --git a/lib/cpp/src/protocol/TProtocolTap.h b/lib/cpp/src/protocol/TProtocolTap.h
index 162f783..07f000d 100644
--- a/lib/cpp/src/protocol/TProtocolTap.h
+++ b/lib/cpp/src/protocol/TProtocolTap.h
@@ -9,9 +9,9 @@
#include <protocol/TOneWayProtocol.h>
-namespace facebook { namespace thrift { namespace protocol {
+namespace apache { namespace thrift { namespace protocol {
-using facebook::thrift::transport::TTransport;
+using apache::thrift::transport::TTransport;
/**
* Puts a wiretap on a protocol object. Any reads to this class are passed
@@ -170,6 +170,6 @@
boost::shared_ptr<TProtocol> sink_;
};
-}}} // facebook::thrift::protocol
+}}} // apache::thrift::protocol
#endif // #define _THRIFT_PROTOCOL_TPROTOCOLTAP_H_ 1