Random.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef ZYPP_BASE_Random_H
00011 #define ZYPP_BASE_Random_H
00012
00013 #include <string>
00014
00016 namespace zypp
00017 {
00018
00019 namespace base
00020 {
00021
00022 int random_int();
00023
00024 std::string random_string(int length);
00025
00026
00028 inline unsigned random()
00029 {
00030 return random_int();
00031 }
00033 inline unsigned random( unsigned size_r )
00034 {
00035 return random_int() % size_r;
00036 }
00038 inline unsigned random( unsigned min_r, unsigned size_r )
00039 {
00040 return min_r + random( size_r );
00041 }
00042
00043
00044 }
00045 }
00046
00047 #endif
00048