当前位置:首页>java>封装(示例代码)

封装(示例代码)

  • 2026-02-05 00:56:56
封装(示例代码)

my_string.h

#pragma once#include<iostream>#include<cstring>using namespace std;class MyString{public:    static const int npos = -1;    // 手动初始化    voidinit(char *s);    /**     * 构造函数(解决手动初始化问题)     * 1、作用:初始化成员变量(属性)--->防止内存泄漏(成员变量有指针成员)     * 2、特点:无返回值/函数名和类名相同/可以重载/自动调用(实例化对象)     * 3、种类     * a/无参构造函数     * 默认无参构造函数:系统自动生成;若类中没有定义其它构造函数,系统默认生成     * b/有参构造函数:拷贝构造函数、类型转换构造函数、移动拷贝构造函数     * explicit:禁止发生隐式类型转换 --- 修饰带一个参数的构造函数     * 默认拷贝构造函数(浅拷贝):若类中没有定义拷贝构造函数,系统会默认生成;     * ---------缺点(浅拷贝(成员变量里有指针成员)-----导致指针指向的同一空间被释放多次;--- 内存错误!):------实现方式:对象之间的成员互相赋值     * 解决问题的方式:     * 自定义实现拷贝构造函数:实现深拷贝     * 拷贝构造函数     */    MyString();                       // 无参构造函数    explicitMyString(constchar *p)// 有参构造函数    explicitMyString(constint &num);    // 有指针成员的时候要用自定义拷贝构造函数,实现深拷贝    // MyString(const MyString &other); // 拷贝构造函数    MyString(MyString &other);  // 拷贝构造函数    MyString(MyString &&other); // 移动拷贝构造函数(优化了,但不同编译器):实现深拷贝,必须要有移动拷贝    /**     * 默认的 = 运算符重载函数:浅拷贝     * 移动 = 运算符重载     */    /**     * 运算符重载:     * 1、运算符重载的作用?代码更加简洁、提高了代码的可读性、体现了C++的可扩充性、运算符重载仅仅只是语法上的方便,它是另一种函数调用的方式、运算符重载本质上是函数重载     * 2、运算符重载的方式?规则?     * 方式:成员函数重载和友元函数重载     * 规则:不允许发明新的运算符、不能改变运算符操作对象的个数、运算符被重载后其优先级和结核性不会改变     * 3、哪些运算符不能被重载:作用域解析运算符::、条件运算符? :、直接访问运算符.、类成员指针引用运算符.*、sizeof运算符     * 4、流运算符为什么只能友元方式重载:左侧运算量是cin或cout而不是对象本身,所以不满足后面一点,就只能申明为友元函数了     * 5、需要会实现一些特殊的运算符重载: ->、*、i++、++i、类型转换运算符    */    // 等号运算符重载函数    // MyString operator=(const MyString &other);    MyString &operator=(MyString &other);  // 接左值:拷贝    MyString &operator=(MyString &&other); // 接右值:移动    /**     * 析构函数     * 1、作用:释放对象成员变量所指向的内存空间,防止内存泄漏     * 2、特点:自动调用(对象离开作用域)/函数名:~类名/无返回值/不能重载     */    // 运算符重载==    bool operator==(const MyString &other); // 成员函数要调用const、non_const版本    bool operator>(const MyString &other);    bool operator>(const MyString &other) const;    // friend bool operator==(const MyString &s1, const MyString &s2); // 友元函数    ~MyString();    // friend bool operator>(const MyString &s1, const MyString &s2);    char operator[](const int index);    char operator[](const int index) const;    friend MyString operator+(const MyString &s1, const MyString &s2);    friend ostream &operator<<(ostream &out, const MyString &s);    friend istream &operator>>(istream &in, MyString &s);    // 类型转换运算符重载    operatorint()    {        return atoi(m_p);    }    // new / delete    void *operatornew(size_t size)    {        cout << "operator new" << end;        void *p = malloc(size);        return p;    }    voidoperatordelete(void *p)    {        cout << "operator delete" << endl;        free(p);        p = nullptr;    }    // 成员函数    // 插入    // 删除    // 替换    // 查找    // 属性    // 迭代器    // 内置类:只能通过外类使用    class Iterator    {    public:        Iterator(char *p) : m_p(p)        {        }        Iterator &operator++()        {            m_p++;            return *this;        }        Iterator operator++(int n)        {            Iterator temp(m_p);            m_p++;            return temp;        }        char operator*()        {            return *m_p;        }        bool operator!=(const Iterator &other)        {            return m_p != other.m_p;        }        bool operator==(const Iterator &other)        {            return m_p == other.m_p;        }    private:        char *m_p;    };    typedef Iterator iterator;    typedef const char *const_iterator;    class Reverse_iterator    {    public:        Reverse_iterator(char *p) : m_p(p)        {        }        Reverse_iterator &operator++()        {            m_p--;            return *this;        }        Reverse_iterator operator++(int n)        {            Reverse_iterator temp(m_p);            m_p--;            return temp;        }        bool operator!=(const Reverse_iterator &other)        {            return m_p != other.m_p;        }        bool operator==(const Reverse_iterator &other)        {            return m_p == other.m_p;        }        char operator*()        {            return *m_p;        }    private:        char *m_p;    };    typedef Reverse_iterator reverse_iterator;    iterator begin();    iterator end();    const_iterator cbegin();    const_iterator cend();    reverse_iterator rbegin();    reverse_iterator rend();    intsize();    constchar *c_str();    // 运算符重载private:    char *m_p; // 野指针};

my_string.cpp

#include"my_string.h"MyString::MyString(){    cout << "MyString" << endl;    m_p = nullptr;}MyString::MyString(const char *p){    cout << "MyString char *" << endl;    // m_p = p;    if (p != nullptr)    {        int len = strlen(p);        m_p = new char[len + 1];        memcpy(m_p, p, len);    }    else    {        m_p = nullptr;    }}MyString::MyString(const int &num){    cout << "MyString int" << endl;    m_p = nullptr;}MyString::MyString(MyString &other) // 深拷贝{    cout << "MyString copy" << endl;    if (other.m_p != nullptr)    {        int len = strlen(other.m_p);        m_p = new char[len + 1];        memcpy(m_p, other.m_p, len);    }    else    {        m_p = nullptr;    }}MyString::MyString(MyString &&other){    cout << "MyString move copy" << endl;    m_p = other.m_p;    other.m_p = nullptr;}MyString::~MyString(){    cout << "~MyString" << endl;    if (m_p != nullptr// 不能释放空    {        delete[] m_p;    }    m_p = nullptr;}MyString &MyString::operator=(MyString &other){    cout << "MyString operator = " << endl;    // m_p = other.m_p; // 浅拷贝    if (other.m_p != nullptr)    {        int len = strlen(other.m_p);        m_p = new char[len + 1];        memcpy(m_p, other.m_p, len);    }    else    {        m_p = nullptr;    }    return *this// 返回当前对象的返回值(copy)}MyString &MyString::operator=(MyString &&other){    cout << "MyString operator move = " << endl;    m_p = other.m_p; // 浅拷贝    other.m_p = nullptr;    return *this// 返回当前对象的返回值(copy)}voidMyString::init(char *s){    m_p = s;}intMyString::size(){    return strlen(m_p);}constchar *MyString::c_str(){    return m_p;}MyString::iterator MyString::begin(){    return m_p;}MyString::iterator MyString::end(){    return m_p + size();}MyString::const_iterator MyString::cbegin(){    return m_p;}MyString::const_iterator MyString::cend(){    return m_p + size();}MyString::reverse_iterator MyString::rbegin(){    return Reverse_iterator(m_p + size());}MyString::reverse_iterator MyString::rend(){    return Reverse_iterator(m_p - 1);}// 运算符重载bool MyString::operator==(const MyString &other){    return strcmp(this->m_p, other.m_p) == 0 ? true : false}bool MyString::operator>(const MyString &other){    return strcmp(this->m_p, other.m_p) > 0 ? true : false}bool MyString::operator>(const MyString &other) const{    return strcmp(const_cast<MyString *>(this)->m_p, other.m_p) > 0 ? true : false}char MyString::operator[](const int index){    return m_p[index];}char MyString::operator[](const int index) const{    return (const_cast<MyString *>(this))->m_p[index];}MyString operator+(const MyString &s1, const MyString &s2){    int len1 = 0;    int len2 = 0;    MyString temp;    if (s1.m_p != nullptr)    {        len1 = strlen(s1.m_p);    }    if (s2.m_p != nullptr)    {        len2 = strlen(s2.m_p);    }    if (len1 + len2 > 0)    {        temp.m_p = new char[len1 + len2 + 1];        memset(temp.m_p, 0, len1 + len2 + 1);        strcat(temp.m_p, s1.m_p);        strcat(temp.m_p, s2.m_p);    }    return temp;}ostream &operator<<(ostream &out, const MyString &s){    out << "data: ";    out << s.m_p;    return out;}istream &operator>>(istream &in, MyString &s){    string s1;    in >> s1;    int len = strlen(s1.c_str());    s.m_p = new char[len + 1];    memcpy(s.m_p, s1.c_str(), len);    return in;}// bool operator==(const MyString &s1, const MyString &s2)// {//     return strcmp(s1.m_p, s2.m_p) == 0 ? true : false;// }// bool operator>(const MyString &s1, const MyString &s2)// {//     return strcmp(s1.m_p, s2.m_p) > 0 ? true : false;// }

main.cpp

#include <iostream>#include "my_string.h"using namespace std;struct Student{    int m_num;    string m_name;    int age;};ostream &operator<<(ostream &outconst Student &stu){    out << "name = " << stu.m_name << endl;    out << "num = " << stu.m_num << endl;    out << "age = " << stu.age << endl;    return out;}// 左右值引用:优点:解决了常引用的缺点voidtest(MyString &&str// 用引用减少不必要的拷贝(接右值){}voidtest(MyString &str// 接左值{}MyString get_str(){    MyString s1("hello");    return s1;}// 缺点:由于有const限定,在函数体内就不能有修改str的操作// void test(const MyString &str)// {// }voidtest(const MyString &s1, const MyString s2){    if (s1 > s2)    {    }}intmain(int argc, char **argv){#if 0    // MyString s1; // 对象存储模型,对象的大小是成员变量总和;成员函数被所有该类的对象共享的    MyString s1; // 自动调用构造函数:MyString();    char *p1 = new char[100]{"hello2"};    {        MyString s2(p1)// MyString(char *p);    }    MyString s3(p1);    // s1.init("hello world"); // 手动初始化;缺点:忘记初始化,后续使用容易造成内存泄漏    // s1.init(p1);    string temp = "hello";    MyString s4(temp.data());    // MyString s5 = "hello world"; // 发生了隐式类型转换    // 缺点:不安全;歧义:误认s5是char *类型    // MyString s6 = 100;    MyString s5("hello world");    MyString s6(5);    // 什么时候调用拷贝构造函数?用已有对象初始化新的对象    MyString s7(s3)// MyString(MyString &other);#endif#if 0    char *p1 = new char[100]{"hello world"};    MyString s1(p1);    MyString s2(s1);    test(s2); // 按引用传递,减少不必要的拷贝    MyString s3;    // s3 = s1; // 不调用拷贝构造函数,实际调 = 运算符重载函数    s3.operator=(s1);#endif#if 0    // 匿名对象/临时对象    // 左值:可以取地址/生命周期长    // 右值:不可以取地址/生命周期短(一条语句长度)    // 左值引用:只能绑定左值/右值引用:只能绑定右值    MyString("hello world");    MyString s1("hello2");    MyString s2;    s2 = MyString("hello"); // 移动(临死的对象还调用了深拷贝)    test(s1);                // 左值    test(MyString("hello")); // 右值引用不能绑定在左值上,加const可以#endif    /**     * 引用:减少不必要的拷贝(函数传参)---左值引用     * 右值引用:减少由临时对象产生的不必要的拷贝问题    */#if 0    char *p = new char[100]{"hello"};    MyString s1(p);    MyString s2(s1);    MyString s3(MyString(p));#endif#if 0    MyString temp = get_str(); // -fno-elide-constructors (关闭函数返回值优化)#endif#if 0    MyString s1("hello");    MyString s2("world");    if (s1 == s2)    // if (s1.operator==(s2))    // if (operator==(s1, s2))    {        cout << "s1 == s2" << endl;    }    else    {        cout << "s1 != s2" << endl;    }    // if (s1 > s2)    if (s1.operator>(s2))    {        cout << "s1 > s2" << endl;    }    else    {        cout << "s1 < s2" << endl;    }    test(s1, s2);    MyString s3;    s3 = s1 + s2;    cout << s3.c_str() << endl;    cout << s3 << endl; // 流运算符只能用友元函数重载,因为流运算符左操作数不是自定义类型,而是cout对象    // operator<<(operator<<(cout, s3), endl)    Student stu = {1"zhangsan"20};    cout << stu;    MyString temp;    cin >> temp;    cout << temp << endl;    cout << temp[2] << endl;#endif#if 0    MyString s1("hello");    MyString s2("HELLO");    for (auto it = s1.begin(); it != s1.end(); it++)    {        cout << *it << endl;    }    for (auto it = s2.rbegin(); it != s2.rend(); ++it)    {        cout << *it << endl;    }#endif    MyString s("123");    int num = static_cast<int>(s);    cout << num << endl;    return 0;}

最新文章

随机文章

基本 文件 流程 错误 SQL 调试
  1. 请求信息 : 2026-02-07 18:31:28 HTTP/2.0 GET : https://f.mffb.com.cn/a/472568.html
  2. 运行时间 : 0.365388s [ 吞吐率:2.74req/s ] 内存消耗:4,695.37kb 文件加载:140
  3. 缓存信息 : 0 reads,0 writes
  4. 会话信息 : SESSION_ID=16745ec93888a69668ffdecd78cb3fab
  1. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/public/index.php ( 0.79 KB )
  2. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/autoload.php ( 0.17 KB )
  3. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_real.php ( 2.49 KB )
  4. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/platform_check.php ( 0.90 KB )
  5. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/ClassLoader.php ( 14.03 KB )
  6. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/composer/autoload_static.php ( 4.90 KB )
  7. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper.php ( 8.34 KB )
  8. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/helper.php ( 2.19 KB )
  9. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/helper.php ( 1.47 KB )
  10. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/stubs/load_stubs.php ( 0.16 KB )
  11. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Exception.php ( 1.69 KB )
  12. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Facade.php ( 2.71 KB )
  13. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/deprecation-contracts/function.php ( 0.99 KB )
  14. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap.php ( 8.26 KB )
  15. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/polyfill-mbstring/bootstrap80.php ( 9.78 KB )
  16. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/Resources/functions/dump.php ( 1.49 KB )
  17. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-dumper/src/helper.php ( 0.18 KB )
  18. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/symfony/var-dumper/VarDumper.php ( 4.30 KB )
  19. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/App.php ( 15.30 KB )
  20. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-container/src/Container.php ( 15.76 KB )
  21. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/container/src/ContainerInterface.php ( 1.02 KB )
  22. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/provider.php ( 0.19 KB )
  23. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Http.php ( 6.04 KB )
  24. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Str.php ( 7.29 KB )
  25. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Env.php ( 4.68 KB )
  26. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/common.php ( 0.03 KB )
  27. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/helper.php ( 18.78 KB )
  28. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Config.php ( 5.54 KB )
  29. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/app.php ( 0.95 KB )
  30. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cache.php ( 0.78 KB )
  31. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/console.php ( 0.23 KB )
  32. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/cookie.php ( 0.56 KB )
  33. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/database.php ( 2.48 KB )
  34. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Env.php ( 1.67 KB )
  35. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/filesystem.php ( 0.61 KB )
  36. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/lang.php ( 0.91 KB )
  37. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/log.php ( 1.35 KB )
  38. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/middleware.php ( 0.19 KB )
  39. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/route.php ( 1.89 KB )
  40. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/session.php ( 0.57 KB )
  41. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/trace.php ( 0.34 KB )
  42. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/config/view.php ( 0.82 KB )
  43. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/event.php ( 0.25 KB )
  44. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Event.php ( 7.67 KB )
  45. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/service.php ( 0.13 KB )
  46. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/AppService.php ( 0.26 KB )
  47. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Service.php ( 1.64 KB )
  48. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Lang.php ( 7.35 KB )
  49. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/lang/zh-cn.php ( 13.70 KB )
  50. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/Error.php ( 3.31 KB )
  51. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/RegisterService.php ( 1.33 KB )
  52. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/services.php ( 0.14 KB )
  53. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/PaginatorService.php ( 1.52 KB )
  54. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ValidateService.php ( 0.99 KB )
  55. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/service/ModelService.php ( 2.04 KB )
  56. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Service.php ( 0.77 KB )
  57. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Middleware.php ( 6.72 KB )
  58. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/initializer/BootService.php ( 0.77 KB )
  59. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Paginator.php ( 11.86 KB )
  60. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-validate/src/Validate.php ( 63.20 KB )
  61. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/Model.php ( 23.55 KB )
  62. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Attribute.php ( 21.05 KB )
  63. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/AutoWriteData.php ( 4.21 KB )
  64. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/Conversion.php ( 6.44 KB )
  65. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/DbConnect.php ( 5.16 KB )
  66. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/ModelEvent.php ( 2.33 KB )
  67. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/concern/RelationShip.php ( 28.29 KB )
  68. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Arrayable.php ( 0.09 KB )
  69. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/contract/Jsonable.php ( 0.13 KB )
  70. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/model/contract/Modelable.php ( 0.09 KB )
  71. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Db.php ( 2.88 KB )
  72. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/DbManager.php ( 8.52 KB )
  73. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Log.php ( 6.28 KB )
  74. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Manager.php ( 3.92 KB )
  75. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerTrait.php ( 2.69 KB )
  76. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/log/src/LoggerInterface.php ( 2.71 KB )
  77. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cache.php ( 4.92 KB )
  78. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/psr/simple-cache/src/CacheInterface.php ( 4.71 KB )
  79. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/helper/Arr.php ( 16.63 KB )
  80. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/driver/File.php ( 7.84 KB )
  81. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/cache/Driver.php ( 9.03 KB )
  82. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/CacheHandlerInterface.php ( 1.99 KB )
  83. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/Request.php ( 0.09 KB )
  84. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Request.php ( 55.78 KB )
  85. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/middleware.php ( 0.25 KB )
  86. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Pipeline.php ( 2.61 KB )
  87. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/TraceDebug.php ( 3.40 KB )
  88. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/middleware/SessionInit.php ( 1.94 KB )
  89. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Session.php ( 1.80 KB )
  90. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/driver/File.php ( 6.27 KB )
  91. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/SessionHandlerInterface.php ( 0.87 KB )
  92. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/session/Store.php ( 7.12 KB )
  93. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Route.php ( 23.73 KB )
  94. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleName.php ( 5.75 KB )
  95. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Domain.php ( 2.53 KB )
  96. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleGroup.php ( 22.43 KB )
  97. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Rule.php ( 26.95 KB )
  98. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/RuleItem.php ( 9.78 KB )
  99. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/route/app.php ( 1.72 KB )
  100. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/Route.php ( 4.70 KB )
  101. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/dispatch/Controller.php ( 4.74 KB )
  102. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/route/Dispatch.php ( 10.44 KB )
  103. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/controller/Index.php ( 4.81 KB )
  104. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/app/BaseController.php ( 2.05 KB )
  105. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/facade/Db.php ( 0.93 KB )
  106. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/connector/Mysql.php ( 5.44 KB )
  107. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/PDOConnection.php ( 52.47 KB )
  108. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Connection.php ( 8.39 KB )
  109. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/ConnectionInterface.php ( 4.57 KB )
  110. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/builder/Mysql.php ( 16.58 KB )
  111. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Builder.php ( 24.06 KB )
  112. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseBuilder.php ( 27.50 KB )
  113. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/Query.php ( 15.71 KB )
  114. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/BaseQuery.php ( 45.13 KB )
  115. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TimeFieldQuery.php ( 7.43 KB )
  116. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/AggregateQuery.php ( 3.26 KB )
  117. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php ( 20.07 KB )
  118. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ParamsBind.php ( 3.66 KB )
  119. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/ResultOperation.php ( 7.01 KB )
  120. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/WhereQuery.php ( 19.37 KB )
  121. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php ( 7.11 KB )
  122. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/TableFieldInfo.php ( 2.63 KB )
  123. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-orm/src/db/concern/Transaction.php ( 2.77 KB )
  124. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/driver/File.php ( 5.96 KB )
  125. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/LogHandlerInterface.php ( 0.86 KB )
  126. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/log/Channel.php ( 3.89 KB )
  127. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/event/LogRecord.php ( 1.02 KB )
  128. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-helper/src/Collection.php ( 16.47 KB )
  129. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/facade/View.php ( 1.70 KB )
  130. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/View.php ( 4.39 KB )
  131. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Response.php ( 8.81 KB )
  132. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/response/View.php ( 3.29 KB )
  133. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/Cookie.php ( 6.06 KB )
  134. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-view/src/Think.php ( 8.38 KB )
  135. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/framework/src/think/contract/TemplateHandlerInterface.php ( 1.60 KB )
  136. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/Template.php ( 46.61 KB )
  137. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/driver/File.php ( 2.41 KB )
  138. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-template/src/template/contract/DriverInterface.php ( 0.86 KB )
  139. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/runtime/temp/067d451b9a0c665040f3f1bdd3293d68.php ( 11.98 KB )
  140. /yingpanguazai/ssd/ssd1/www/f.mffb.com.cn/vendor/topthink/think-trace/src/Html.php ( 4.42 KB )
  1. CONNECT:[ UseTime:0.000896s ] mysql:host=127.0.0.1;port=3306;dbname=f_mffb;charset=utf8mb4
  2. SHOW FULL COLUMNS FROM `fenlei` [ RunTime:0.001416s ]
  3. SELECT * FROM `fenlei` WHERE `fid` = 0 [ RunTime:0.047098s ]
  4. SELECT * FROM `fenlei` WHERE `fid` = 63 [ RunTime:0.101393s ]
  5. SHOW FULL COLUMNS FROM `set` [ RunTime:0.001556s ]
  6. SELECT * FROM `set` [ RunTime:0.018262s ]
  7. SHOW FULL COLUMNS FROM `article` [ RunTime:0.001527s ]
  8. SELECT * FROM `article` WHERE `id` = 472568 LIMIT 1 [ RunTime:0.008237s ]
  9. UPDATE `article` SET `lasttime` = 1770460288 WHERE `id` = 472568 [ RunTime:0.006188s ]
  10. SELECT * FROM `fenlei` WHERE `id` = 65 LIMIT 1 [ RunTime:0.003028s ]
  11. SELECT * FROM `article` WHERE `id` < 472568 ORDER BY `id` DESC LIMIT 1 [ RunTime:0.009560s ]
  12. SELECT * FROM `article` WHERE `id` > 472568 ORDER BY `id` ASC LIMIT 1 [ RunTime:0.005496s ]
  13. SELECT * FROM `article` WHERE `id` < 472568 ORDER BY `id` DESC LIMIT 10 [ RunTime:0.007952s ]
  14. SELECT * FROM `article` WHERE `id` < 472568 ORDER BY `id` DESC LIMIT 10,10 [ RunTime:0.002287s ]
  15. SELECT * FROM `article` WHERE `id` < 472568 ORDER BY `id` DESC LIMIT 20,10 [ RunTime:0.002162s ]
0.371773s