|bool ||getUptime (time_t &uptime)|
| ||Returns uptime statistics. |
|bool ||getMemStats (int &totalMB, int &freeMB, int &totalVM, int &freeVM)|
| ||Returns memory statistics in megabytes. |
|bool ||hasUtf8 (const char *str)|
| ||Guess whether a string is UTF-8. |
|bool ||ping (const QString &host, int timeout)|
| ||Can we ping host within timeout seconds? |
|bool ||telnet (const QString &host, int port)|
| ||Can we talk to port on host? |
|long long ||copy (QFile &dst, QFile &src, uint block_size)|
| ||Copies src file to dst file. |
|QString ||createTempFile (QString name_template, bool dir)|
|bool ||makeFileAccessible (QString filename)|
| ||Makes a file accessible to all frontends/backends. |
|QString ||getResponse (const QString &query, const QString &def)|
| ||In an interactive shell, prompt the user to input a string. |
|int ||intResponse (const QString &query, int def)|
| ||In an interactive shell, prompt the user to input a number. |
|QString ||getSymlinkTarget (const QString &start_file, QStringList *intermediaries, unsigned maxLinks)|
|bool ||IsMACAddress (QString MAC)|
|QString ||FileHash (QString filename)|
|bool ||WakeOnLAN (QString MAC)|
|bool ||IsPulseAudioRunning (void)|
| ||Is A/V Sync destruction daemon is running on this host? |
|bool ||myth_nice (int val)|
|void ||myth_yield (void)|
|bool ||myth_ioprio (int val)|
| ||range -1..8, smaller is higher priority |
|bool ||MythRemoveDirectory (QDir &aDir)|
|void ||setHttpProxy (void)|
| ||Get network proxy settings from OS, and use for [Q]Http[Comms]. |
|void ||wrapList (QStringList &list, int width)|
|QString ||xml_indent (uint level)|
Copies src file to dst file.
If the dst file is open, it must be open for writing. If the src file is open, if must be open for reading.
The files will be in the same open or close state after this function runs as they were prior to this function being called.
This function does not care if the files are actual files. For compatibility with pipes and socket streams the file location will not be reset to 0 at the end of this function. If the function is successful the file pointers will be at the end of the copied data.
|dst||Destination QFile |
|src||Source QFile |
|block_size||Optional block size in bytes, must be at least 1024, otherwise the default of 16 KB will be used. |
- bytes copied on success, -1 on failure.
Definition at line 295 of file mythmiscutil.cpp.
Referenced by mythburn::copyRemote(), VAAPIContext::CopySurfaceToFrame(), mythburn::doProcessFile(), mythburn::doProcessFileProjectX(), VideoVisualGoom::Draw(), mythburn::getFileInformation(), PrivateDecoderCrystalHD::GetFrame(), nv_python_libs.common.common_api.Common::getUrlData(), HLSStream::HLSStream(), ImportRecorder::Open(), mythburn::preProcessFile(), MythImage::Reflect(), trail_space(), nv_python_libs.xsltfunctions.traileraddicts_api.xpathFunctions::traileraddictsLinkGenerationMovie(), and ThumbFinder::updateThumb().
Makes a file accessible to all frontends/backends.
This function abstracts the functionality of making a file accessible to all frontends and backends. Currently it contains a permissions hack that makes a file accessible even on a system with an improperly configured environment (umask/group) where the frontend and backend are being run as different users or where a NFS share is used but UID's/GID's differ on different hosts.
Though the function currently only changes the file mode to 0666, by abstracting the functionality, it will be easier to make changes in the future if a better approach is chosen. Similarly, using this function allows the hack to be applied only when required if code is written to detect or allow the user to specify their system is misconfigured.
|filename||Path of file to make accessible |
Definition at line 424 of file mythmiscutil.cpp.
Referenced by Content::GetPreviewImage(), DataDirectProcessor::SaveLineupToCache(), and PreviewGenerator::SavePreview().
Get network proxy settings from OS, and use for [Q]Http[Comms].
The HTTP_PROXY environment var. is parsed for values like; "proxy-host", "proxy-host:8080", "http://host:8080" and "http"//user:password:1080", and that is used for any Qt-based Http fetches. We also test connectivity here with ping and telnet, and warn if it fails.
If there is was no env. var, we use Qt to get proxy settings from the OS, and search through them for a proxy server we can connect to.
Definition at line 831 of file mythmiscutil.cpp.
Referenced by main().