3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 19:27:06 +00:00
z3/src/util/file_path.h
Nikolaj Bjorner d0e20e44ff booyah
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
2020-07-04 15:56:30 -07:00

38 lines
580 B
C

/*++
Copyright (c) 2017 Microsoft Corporation
Module Name:
file_path.h
Abstract:
File path functions.
Author:
Nikolaj Bjorner (nbjorner) 2017-11-19
Revision History:
--*/
#pragma once
#include <cstring>
inline char const * get_extension(char const * file_name) {
if (file_name == nullptr)
return nullptr;
char const * last_dot = nullptr;
for (;;) {
char const * tmp = strchr(file_name, '.');
if (tmp == nullptr) {
return last_dot;
}
last_dot = tmp + 1;
file_name = last_dot;
}
}