Back to index

openldap  2.4.31
SaslInteraction.cpp
Go to the documentation of this file.
00001 // $OpenLDAP$
00002 /*
00003  * Copyright 2007-2012 The OpenLDAP Foundation, All Rights Reserved.
00004  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
00005  */
00006 
00007 #include <SaslInteraction.h>
00008 #include <iostream>
00009 #include "debug.h"
00010 
00011 SaslInteraction::SaslInteraction( sasl_interact_t *interact ) :
00012         m_interact(interact) {}
00013 
00014 SaslInteraction::~SaslInteraction()
00015 {
00016     DEBUG(LDAP_DEBUG_TRACE, "SaslInteraction::~SaslInteraction()" << std::endl);
00017 }
00018 
00019 unsigned long SaslInteraction::getId() const
00020 {
00021     return m_interact->id;
00022 }
00023 
00024 const std::string SaslInteraction::getPrompt() const
00025 {
00026     return std::string(m_interact->prompt);
00027 }
00028 
00029 const std::string SaslInteraction::getChallenge() const
00030 {
00031     return std::string(m_interact->challenge);
00032 }
00033 
00034 const std::string SaslInteraction::getDefaultResult() const
00035 {
00036     return std::string(m_interact->defresult);
00037 }
00038 
00039 void SaslInteraction::setResult(const std::string &res)
00040 {
00041     m_result = res;
00042     m_interact->result = m_result.data();
00043     m_interact->len = m_result.size();
00044 }