]> git.saurik.com Git - apple/security.git/blobdiff - Security/libsecurity_transform/lib/NullTransform.cpp
Security-57031.1.35.tar.gz
[apple/security.git] / Security / libsecurity_transform / lib / NullTransform.cpp
diff --git a/Security/libsecurity_transform/lib/NullTransform.cpp b/Security/libsecurity_transform/lib/NullTransform.cpp
new file mode 100644 (file)
index 0000000..4db1a70
--- /dev/null
@@ -0,0 +1,61 @@
+#include "NullTransform.h"
+
+NullTransform::NullTransform() : Transform(CFSTR("NullTransform"))
+{
+}
+
+
+
+CFTypeRef NullTransform::Make()
+{
+       return CoreFoundationHolder::MakeHolder(gInternalCFObjectName, new NullTransform());
+}
+
+
+
+void NullTransform::AttributeChanged(CFStringRef name, CFTypeRef value)
+{
+       // move input to output, otherwise do nothing
+       if (CFStringCompare(name, kSecTransformInputAttributeName, 0) == kCFCompareEqualTo)
+       {
+               SetAttributeNoCallback(kSecTransformOutputAttributeName, value);
+       }
+}
+
+
+
+std::string NullTransform::DebugDescription()
+{
+       return Transform::DebugDescription() + ": NullTransform";
+}
+
+
+
+class NullTransformFactory : public TransformFactory
+{
+public:
+       NullTransformFactory();
+       
+       virtual CFTypeRef Make();
+};
+
+
+
+TransformFactory* NullTransform::MakeTransformFactory()
+{
+       return new NullTransformFactory();
+}
+
+
+
+NullTransformFactory::NullTransformFactory() : TransformFactory(CFSTR("Null Transform"))
+{
+}
+
+
+
+CFTypeRef NullTransformFactory::Make()
+{
+       return NullTransform::Make();
+}
+