<rdar://problem/12446320> Fixing an issue with our Driver where setting an immediate output would not cause suppression of the final printout. This allows effective output redirection for Python commands
llvm-svn: 166058
This commit is contained in:
@@ -268,7 +268,7 @@ SBCommandReturnObject::SetImmediateOutputFile (FILE *fh)
|
||||
if (m_opaque_ap.get())
|
||||
m_opaque_ap->SetImmediateOutputFile (fh);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
SBCommandReturnObject::SetImmediateErrorFile (FILE *fh)
|
||||
{
|
||||
@@ -285,6 +285,46 @@ SBCommandReturnObject::PutCString(const char* string, int len)
|
||||
}
|
||||
}
|
||||
|
||||
const char *
|
||||
SBCommandReturnObject::GetOutput (bool only_if_no_immediate)
|
||||
{
|
||||
if (!m_opaque_ap.get())
|
||||
return NULL;
|
||||
if (only_if_no_immediate == false || m_opaque_ap->GetImmediateOutputStream().get() == NULL)
|
||||
return GetOutput();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *
|
||||
SBCommandReturnObject::GetError (bool only_if_no_immediate)
|
||||
{
|
||||
if (!m_opaque_ap.get())
|
||||
return NULL;
|
||||
if (only_if_no_immediate == false || m_opaque_ap->GetImmediateErrorStream().get() == NULL)
|
||||
return GetError();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t
|
||||
SBCommandReturnObject::GetErrorSize (bool only_if_no_immediate)
|
||||
{
|
||||
if (!m_opaque_ap.get())
|
||||
return NULL;
|
||||
if (only_if_no_immediate == false || m_opaque_ap->GetImmediateErrorStream().get() == NULL)
|
||||
return GetErrorSize();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t
|
||||
SBCommandReturnObject::GetOutputSize (bool only_if_no_immediate)
|
||||
{
|
||||
if (!m_opaque_ap.get())
|
||||
return NULL;
|
||||
if (only_if_no_immediate == false || m_opaque_ap->GetImmediateOutputStream().get() == NULL)
|
||||
return GetOutputSize();
|
||||
return NULL;
|
||||
}
|
||||
|
||||
size_t
|
||||
SBCommandReturnObject::Printf(const char* format, ...)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user