1 /*---------------------------------------------------------------------\
3 | |__ / \ / / . \ . \ |
8 \---------------------------------------------------------------------*/
9 /** \file zypp/media/CredentialFileReader.h
12 #ifndef ZYPP_MEDIA_CREDENTIALFILEREADER_H
13 #define ZYPP_MEDIA_CREDENTIALFILEREADER_H
15 #include "zypp/base/Function.h"
17 #include "zypp/Pathname.h"
19 #include "zypp/media/MediaUserAuth.h"
21 ///////////////////////////////////////////////////////////////////
23 { /////////////////////////////////////////////////////////////////
24 ///////////////////////////////////////////////////////////////////
26 { /////////////////////////////////////////////////////////////////
29 //////////////////////////////////////////////////////////////////////
31 // CLASS NAME : CredentialFileReader
33 class CredentialFileReader
37 * Callback definition.
38 * First parameter is the \ref Url with which the credentials are
39 * associated, the second are the credentials.
41 * Return false from the callback to get a \ref AbortRequestException
42 * to be thrown and the processing to be cancelled.
44 typedef function<bool(AuthData_Ptr &)> ProcessCredentials;
46 CredentialFileReader(const Pathname & crfile,
47 const ProcessCredentials & callback);
48 ~CredentialFileReader();
50 ProcessCredentials _callback;
52 //////////////////////////////////////////////////////////////////////
55 /////////////////////////////////////////////////////////////////
57 ///////////////////////////////////////////////////////////////////
58 /////////////////////////////////////////////////////////////////
60 ///////////////////////////////////////////////////////////////////
62 #endif /* ZYPP_MEDIA_CREDENTIALFILEREADER_H */